dhellmann / rst2blogger

Convert reStructuredText to HTML suitable for posting to Blogger
Other
13 stars 6 forks source link

failure to authorize by ClientLogin #8

Open zooko opened 11 years ago

zooko commented 11 years ago

HACK zompu:~/playground/zooko.com$ rst2blogger --blog "thoughts upon news of the death of Aaron Swartz" aaronsw-1.rst

Title: 'None'

Please choose the authorization mechanism you want to use.

  1. to use your email address and password (ClientLogin)
  2. to use a web browser to visit an auth web page (AuthSub)
  3. if you have registed to use OAuth : 1 Please enter your username: zookog Password: Retreiving blog list Traceback (most recent call last): File "/usr/local/bin/rst2blogger", line 9, in load_entry_point('rst2blogger==1.0.1', 'console_scripts', 'rst2blogger')() File "/usr/local/lib/python2.7/dist-packages/rst2blogger-1.0.1-py2.7.egg/rst2blogger/cli.py", line 84, in main target_blog_id = target_blog.get_blog_id() File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.17-py2.7.egg/gdata/blogger/data.py", line 65, in get_blog_id raise Exception('no match %r in %r' % (BLOG_ID2_PATTERN, self.id.text)) Exception: no match <_sre.SRE_Pattern object at 0xf15fd0> in 'tag:blogger.com,1999:user-g108313527900507320366.blog-2125315943656881857'

The line that raises that exception was added by me in order to get more diagnostics about this.

zooko commented 11 years ago

I looked more closely, and changing the regex to this fixes the problem:

BLOG_ID2_PATTERN = re.compile('tag:blogger.com,1999:user-(g?\d+).blog-(\d+)')

I believe I "upgraded" by blogger account to google just before this broke, so I conclude that doing that caused a "g" to be prepended to my user id.