GNOME Bugzilla – Bug 151291
Make Blogger.com use Atom API rather than BloggerAPI
Last modified: 2010-03-08 19:16:57 UTC
1. open gnome-blog. 2. set an blogger.com account. 3. post a message with a title... the expected result: the tile I wrote appeas as title. real result: the title I filled in became part of the body field of the blog entry. And the title field of the posted entry is null..
I also experience this bug. The title I enter should be inserted where <$BlogItemTitle$> sits in the template. Quickly checking Blogger's old API, blogger.newPost does not have a parameter for titles. I am afraid gnome-blog will have to become AtomEnabled for this . . . if it is already, then I want my titles, darn it! :D
Same here. I've tried this with Blogger.com and b2evolution. The title becomes part of the blog body. My Python really stinks, but I'll try to find a solution to this little problem. If I find one, I'll post a patch here. Ariejan de Vroom ariejan at ariejan dot com
Okay, I fixed the problem. Some blogs will take the first line as a title. Others look for <title>My Title</title>. In my case I edited bloggerAPI.py (/usr/lib/python-2.3/site-packages/gnomeblog/bloggerAPI.py) at line 62. Here's the diff output. --- bloggerAPI.py.orig 2004-10-08 09:47:28.807841200 +0200 +++ bloggerAPI.py 2004-10-08 09:44:41.092337832 +0200 @@ -59,7 +59,8 @@ blog_id = client.get_string(gconf_prefix + "/blog_id") - content = title + "\n" + entry + content = "<title>" + title + "</title>" + entry + #content = title + "\n" + entry success = gtk.TRUE server = xmlrpclib.Server(url) I'll attach this diff as an attachment so you may easily patch your installation. ( Go the the directory where your bloggerAPI.py is, and execute: patch < gnome-bugfix-151291.diff )
Hi Ariejan de Vroom: I tested the patch. But it does not work in my blogger account. Although I found some documents describe the method you are using: http://www.livejournal.com/doc/server/ljp.csp.blogger.html http://cafelog.com/index.php?p=413&c=1 But I am not sure whether they are talking about blogger.com or some other blog system that using blogger API. Would you specify which blog are you using? Blogger.com? Thanks. regards, yalding
I am using b2evolution on my personal webserver. The way I did it was to captupe the network output of a windows-based blogger (w.bloggar). I'll try the same with my Blogger.com account today.
*** Bug 139940 has been marked as a duplicate of this bug. ***
It appears Wordpress expects <title> tags too, as per #152051
I had this problem too, but I'm glad to say that the patch sort of works in principle. The problem is, with blogger in particular, you might be using any one of a variety of templates either written by yourself or supplied by blogger.com. The patch didn't work for me, so I had to change line 62 to : content = "<h3 class=\"post-title\">" + title + "</h3>" + entry This is to match the structure of my personal template. However the title and the body of the post are still both ending up within <$BlogItemBody$> ...the title should go in <$BlogItemTitle$> instead. Here is the relevant section from my template: <div class="post"><a name="<$BlogItemNumber$>"></a> <BlogItemTitle> <BlogItemUrl><a href="<$BlogItemUrl$>" title="external link" class="title-link"></BlogItemUrl> <h3 class="post-title"> <$BlogItemTitle$> </h3> <BlogItemUrl></a></BlogItemUrl> </BlogItemTitle> <div class="post-body"> <p> <$BlogItemBody$> </p> </div> <p class="post-footer"> <em>posted by <$BlogItemAuthorNickname$> @ <a href="<$BlogItemPermalinkUrl$>" title="permanent link"><$BlogItemDateTime$></a></em> <BlogItemCommentsEnabled> <a class="comment-link" href="<$BlogItemPermalinkURL$>#comments"><$BlogItemCommentCount$> comments</a> </BlogItemCommentsEnabled> <$BlogItemControl$> </p> </div> I will continue playing to see if I can get gnome-blog to separate title and body properly. Thanks for the tip anyway Ariejan! Bye for now.
OK I have now done some basic research which is probably old hat to all you guys. I have worked out (I think) that the problem is that new blogger templates such as mine are designed for use with the new Atom API. It's not compatible with the Blogger 1.0 API, which doesn't support the title parameter to blogger.newPost So basically Richard Swarting (above) was right. We need gnome-blog to get AtomEnabled. (Meanwhile I have two options; use an older template or do all my posts from the blogger website.) I don't know if this is underway yet or not. These links might help. http://www.atomenabled.org/developers/api/AtomAPI.wsdl http://www.daikini.com/source/atomexamples/ http://beetle.cbtlsl.com/archives/category/pyblogger http://diveintomark.org/archives/2004/05/27/howto-atom-linkblog
Retitling to reflect this bug is about adding Atom support.
*** Bug 142238 has been marked as a duplicate of this bug. ***
Created attachment 70269 [details] [review] patch for blogger.com Atom API support
Comment on attachment 70269 [details] [review] patch for blogger.com Atom API support Needs pycurl. I think that i am not a good programmer because i am a beginner, so please review this patch pedantic. Memory footprint of getXML() in html_converter.py can surely be improved by not using xml.dom to convert a string to it's properly escaped version. Plus, the error messages represented to the user a stupid, but i couldn't think of any better ones.
Can please someone comment on/review my patch? Even if it doesnt get included, i wanted to know how i can improve it. Thanks.
Is anybody working on this anymore? The last comment is over 8 months old. At the moment gnome-blog (0.9.1) does not work for me at all on blogger.com after I have moved to the newer google based system. For example, adding my name and password and clicking on "Lookup Blogs" gets the following response >gnome-blog-poster Using gconf_prefix /apps/gnome-blog /usr/local/lib/python2.5/site-packages/gnomeblog/gconf_widgets.py:6: DeprecationWarning: use gtk.ComboBox gtk.OptionMenu.__init__(self) blog type: blogger.com Setting: /apps/gnome-blog/blog_protocol to bloggerAPI Using prefix /apps/gnome-blog Getting list for RPC interface http://www.blogger.com/api/RPC2 Traceback (most recent call last):
+ Trace 153900
blog_id_pairs = blog.getBlogList(gconf_prefix)
raise FeatureNotSupported("getBlogList") gnomeblog.blog.FeatureNotSupported: Blog protocol does not support 'getBlogList'
Created attachment 103252 [details] [review] patch for Blogger ATOM (disclaimer: there may be a license issue) This patch essentially creates a protocol class analogous to the old Blogger one, but with implementations of getBlogList() and postEntry() appropriate for the new ATOM API. It rebrands the old API as "blogger.com (old)" and assumes its former branding "blogger.com". Issues with it are that it doesn't consider GNOME Proxy settings at present (does it actually have to do that explicitly?) and a license issue. The license issue is that it employs the Google Data API Python client library (http://code.google.com/p/gdata-python-client/) which is licensed under the Apache License 2.0. Their website says that it is incompatible with GPLv2 (but not GPLv3). I am wondering whether this means anything to GNOME Blog, as there is no modification or mixing of code between GNOME Blog or the GData python client library through this patch: GNOME Blog just consumes it as a library installed elsewhere on the system. If the license isn't an issue for this usage, while it may be undesirable, depending on the library for GNOME Blog, using the library seems like the "proper" solution to me. Please comment.
Created attachment 103276 [details] [review] patch for Blogger ATOM (v2) Updated to catch, handle socket.gaierror errors when communicating with the server. Unfortunately, my solution is to prompt the user to "Please try again.", as that's what works for me. socket.gaierror: (-2, 'Name or service not known')
(In reply to comment #17) > Created an attachment (id=103276) [edit] > patch for Blogger ATOM (v2) > > Updated to catch, handle socket.gaierror errors when communicating with the > server. Unfortunately, my solution is to prompt the user to "Please try > again.", as that's what works for me. > > socket.gaierror: (-2, 'Name or service not known') > I tested that patch on Fedora 7. First than all, patch rejected to add the module in protocols/Makefile.am. I added manualy. Then, the installation doesn't copy the file atomBloggerAPI.py in the corresponding site-packages folder. It seems that protocols/Makefile has an aditional definition for gnomeblog_PYTHON and I had to edit it again. After that, I had to solve aditional dependencies of the new module: pygtk-devel (at configure time), python-gdata (runtime) and python-feedparser(runtime)... After all it seems to work great with blogger.com Nice work! Thanks
UPS!! now gnome-panel can't load it! "...gnome-panel had a problem loading OAFIID:GNOME_BlogApplet..." I had to reinstall the fedora package gnome-blog and then copy/update the files blogger_prefs.py and atomBloggerAPI.py from the builded gnome-blog to /usr/lib/python2.5/site-packages/gnomeblog/ Now i can use it as a gnome applet
I have tested the path on ubuntu 8.04.1 with the same results. I tryed to build a package but I can't make it to contain the new file "atomBloggerAPI.py". So I had to copy it by hand to /var/lib/python-support/python2.5/gnomeblog Nice patch
Created attachment 146704 [details] [review] Patch adding AtomBlogger support I've updated the previous patch a little. It now also sets keywords for labels. Instead of having two separate Blogger.com options, Blogger.com now uses the new Atom API while the old API is still around for pybloxom or whatever it is that uses it.
Created attachment 146716 [details] [review] Patch adding AtomBlogger support Fixes a couple deprecation warnings and stuff.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
http://git.gnome.org/browse/gnome-blog/patch/?id=ca10747e8180f9927594fa24861b9581da2b17f0 The patch as applied is missing the new file, atomBloggerAPI.py, that was created in the supplied patch. The supplied patch is in diff-style rather than from git format: is that why the new file failed to apply? The "make install" step is now broken. Thanks to Tommi Asiala for noticing and contacting me about it. Should I submit a separate patch for the new file now?
I used patch, not git.
Thanks for responding :) Sorry for failing to test it properly at the time.
+ Trace 220826
import atom
Another missing file or am I just unable to find that module with Ubuntu 9.10?
Hey Tommi. Thanks for renewing interest in GNOME Blog. The patch requires the atom python package found in python-gdata package (got through apt or yum, etc). When I originally provided my patch, I was less aware of issues with external dependencies like this. I'm not sure, but I think I'm obliged to either * request python-gdata be an external dependency, * rework the patch so that this AtomBlogger support is conditional on python-gdata's atom support being available, or * make use of the C-based libgdata instead. I will post again when I find something out.
That all does not apply, gnome-blog is not an official GNOME module; it can do whatever it wants. Making it optional can be handled in a new bug. No need to keep reopening this one.
Ah, thanks. I'll open a new one once I have a patch.