Re: post blog using python API
Tom <[email protected]>
| Newsgroups | gmane.comp.web.blogger.api |
|---|---|
| Message-ID | <[email protected]> |
Hi John, Thanks for your suggestion. I am using the API in google app engine for myself. I download gdata from https://github.com/google/gdata-python-client , but still got the same error. Since I am just using the API to post blog for myself, oauth seems to complicated to me. I have try to read Google docs, but still can't find out how to do it. Do you know where to get the latest gdata package? Thanks, Donghua On Wednesday, July 1, 2015 at 8:27:36 AM UTC+8, John Wood wrote: > > I believe the correct way is to switch to using oauth2. > > However, I found that updating the gdata libary from Google fixed a > similar issue for me - although I'm not sure for how long. > > on linux it was just > > sudo pip install --upgrade gdata > > if that doesn't work, try > > sudo pip install --upgrade google-api-python-client > > as well. I did both while working on this recently, but I think it was > just the first one that mattered. > > oauth makes my head hurt, so I'm trying to avoid those changes for as long > as possible. That and the picasaweb api doesn't seem to have been updated, > and I need that one as well > > On 30 June 2015 at 08:35, Tom <[email protected] <javascript:>> wrote: > >> Hi Experts, >> >> I find a script to keep update my blog using python API failed with >> message: >> >> {'status': 401, 'body': 'User does not have permission to create new post', 'reason': 'Unauthorized'} >> >> I am using following code: >> >> #email = "email--addr--###gmail.com" >> #password = "PassWord" >> #blog_id = "2711*********08" >> >> >> blogger_service = gdata.service.GDataService(email, password) >> blogger_service.source = 'exampleCo-exampleApp-1.0' >> blogger_service.service = 'blogger' >> blogger_service.account_type = 'GOOGLE' >> blogger_service.server = 'www.blogger.com' >> blogger_service.ProgrammaticLogin() >> >> entry = gdata.GDataEntry() >> entry.title = atom.Title('xhtml', title) >> entry.content = atom.Content(content_type='html', text=blog_content) >> >> return blogger_service.Post(entry, '/feeds/%s/posts/default' % blog_id) >> >> This works for the past several years, but failed from June 22. >> What should I do to fix the issue? >> >> Thanks, >> Tom >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Blogger Developer Group" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/bloggerdev. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/bloggerdev. For more options, visit https://groups.google.com/d/optout.