Thanks reply.
The complete code is difficult. However, the following simple code to
reproduce.
GData libraries, GoogleCode for download.
http://code.google.com/p/gdata-python-client/downloads/detail?name=gdata-2.0.13.zip
tanks!
app.yaml
-----
application: gdatatesting
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: helloworld.py
-----
helloworld.py
-----
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import atom
import gdata.urlfetch
import gdata.blogger.client
import gdata.blogger.service
blog_id = '3647310196379350198'
post_id = '2104562001412323939'
comment = {}
comment['username'] = 'youraccount' # google account
comment['password'] = 'yourpassword' # password
comment['content'] = 'test'
client =
gdata.blogger.service.BloggerService(email=comment['username'],
password=comment['password'],
source="TESTER")
client.ProgrammaticLogin()
new_comment = gdata.blogger.CommentEntry()
new_comment.content = atom.Content(text=comment['content'])
message = ""
try:
posted = client.AddComment(new_comment, blog_id=blog_id,
post_id=post_id)
message = 'Comment Post Success!'
except gdata.service.BadAuthentication, e:
message = e
except gdata.service.RequestError, e:
message = e.message['body']
except Exception, e:
message = e
print 'Content-Type: text/html'
print ''
print '<html><body>'
print "%s" % (message)
print '</body></html>'
-----
On 1ζ21ζ₯, εεΎ12:19, Brett Morgan <brettmor...@google.com> wrote:
> Hi,
>
> Can you please supply the full code to your AppEngine instance to me? We are
> looking at the logs currently, and I want more information on what is
> happening.
>
> brett
>
>
>
>
>
>
>
>
>
> On Fri, Jan 21, 2011 at 1:55 PM, ishikawa.rs <ishikawa...@gmail.com> wrote:
> > Hello.
>
> > I can't post a comment via GData Blogger API.
> > I got status code 500 and error code 'bX-dr4jk' in message.
> > using python appengine.
>
> > What happen?
>
> > Any idea?
>
> > * I also posted to Blogger Forum.
>
> >http://www.google.com/support/forum/p/blogger/thread?tid=1c4cb3d8c221...
>
> > thanks.
>
> > --- code is simple ---
> > client =
> > gdata.blogger.service.BloggerService(email=comment['username'],
>
> > password=comment['password'],
> > source="TESTER")
> > client.ProgrammaticLogin()
> > new_comment = gdata.blogger.CommentEntry()
> > new_comment.content = atom.Content(text=comment['content'])
>
> > posted = client.AddComment(new_comment, blog_id=blog_id,
> > post_id=post_id)
> > -----
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Blogger Developer Group" group.
> > To post to this group, send email to bloggerdev@googlegroups.com.
> > To unsubscribe from this group, send email to
> > bloggerdev+unsubscribe@googlegroups.com<bloggerdev%2Bunsubscribe@googlegrou ps.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/bloggerdev?hl=en.
>
> --
>
> Brett Morgan
>
> Developer Programs Engineer, Blogger
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.
No comments:
Post a Comment