Search This Site

Custom Search

Tuesday, June 22, 2010

[bloggerDev] Uploading posts through api add a lot of
tags, how to avoid that?

Hi! I'm using the python API http://code.google.com/apis/blogger/docs/1.0/developers_guide_python.html
to upload posts to blogger and it works very well.

The problem is that if in the content filed I put my html (formatted)
it inserts a lot of <br/>, for example:

def CreatePublicPost(blogger_service, blog_id, title, content):
entry = gdata.GDataEntry()
entry.title = atom.Title('xhtml', title)
entry.content = atom.Content(content_type='html', text=content)
return blogger_service.Post(entry, '/feeds/%s/posts/default' %
blog_id)

content = """<p>hello</p>
<p>bye</p>"""

CreatePublicPost(...,content)

would publish an entry with something like that:

<p>hello</p><br/>
<p>bye</p>

There's a way to avoid that? Why this behaviour?

--
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