After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 151291 - Make Blogger.com use Atom API rather than BloggerAPI
Make Blogger.com use Atom API rather than BloggerAPI
Status: RESOLVED FIXED
Product: gnome-blog
Classification: Other
Component: Blog Applet
unspecified
Other Linux
: High normal
: ---
Assigned To: GNOME blog maintainers
GNOME blog maintainers
: 139940 142238 (view as bug list)
Depends on:
Blocks: 166989
 
 
Reported: 2004-08-28 14:05 UTC by Yajun Wang
Modified: 2010-03-08 19:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for blogger.com Atom API support (12.88 KB, patch)
2006-08-05 17:15 UTC, Martin Ammermüller
none Details | Review
patch for Blogger ATOM (6.80 KB, patch)
2008-01-20 12:32 UTC, Richard Schwarting
none Details | Review
patch for Blogger ATOM (v2) (7.01 KB, patch)
2008-01-20 19:30 UTC, Richard Schwarting
none Details | Review
Patch adding AtomBlogger support (6.70 KB, patch)
2009-11-02 00:54 UTC, Richard Schwarting
none Details | Review
Patch adding AtomBlogger support (6.90 KB, patch)
2009-11-02 03:34 UTC, Richard Schwarting
committed Details | Review

Description Yajun Wang 2004-08-28 14:05:43 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..
Comment 1 Richard Schwarting 2004-10-05 20:59:36 UTC
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
Comment 2 Ariejan de Vroom 2004-10-07 12:35:54 UTC
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
Comment 3 Ariejan de Vroom 2004-10-08 07:59:56 UTC
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 )
Comment 4 Yajun Wang 2004-10-10 03:34:09 UTC
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
Comment 5 Ariejan de Vroom 2004-10-11 07:32:34 UTC
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. 
Comment 6 Seth Nickell 2004-10-27 03:01:09 UTC
*** Bug 139940 has been marked as a duplicate of this bug. ***
Comment 7 Seth Nickell 2004-10-27 03:32:03 UTC
It appears Wordpress expects <title> tags too, as per #152051
Comment 8 Francis Barton 2004-11-27 12:43:20 UTC
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> &nbsp;
      <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.
Comment 9 Francis Barton 2004-11-27 16:01:40 UTC
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
Comment 10 Seth Nickell 2005-01-02 07:14:40 UTC
Retitling to reflect this bug is about adding Atom support.
Comment 11 Seth Nickell 2005-01-13 01:46:09 UTC
*** Bug 142238 has been marked as a duplicate of this bug. ***
Comment 12 Martin Ammermüller 2006-08-05 17:15:41 UTC
Created attachment 70269 [details] [review]
patch for blogger.com Atom API support
Comment 13 Martin Ammermüller 2006-08-05 17:19:38 UTC
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.
Comment 14 Martin Ammermüller 2006-12-30 16:34:57 UTC
Can please someone comment on/review my patch? Even if it doesnt get included, i wanted to know how i can improve it. Thanks.
Comment 15 Lachlan Michael 2007-08-09 06:39:30 UTC
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):
  • File "/usr/local/lib/python2.5/site-packages/gnomeblog/blogger_prefs.py", line 192 in _onLookupBlogsButton
    blog_id_pairs = blog.getBlogList(gconf_prefix)
  • File "/usr/local/lib/python2.5/site-packages/gnomeblog/blog.py", line 15 in getBlogList
    raise FeatureNotSupported("getBlogList") gnomeblog.blog.FeatureNotSupported: Blog protocol does not support 'getBlogList'

Comment 16 Richard Schwarting 2008-01-20 12:32:03 UTC
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.
Comment 17 Richard Schwarting 2008-01-20 19:30:37 UTC
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')
Comment 18 Jorge Urdaneta 2008-07-01 23:46:29 UTC
(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
Comment 19 Jorge Urdaneta 2008-07-01 23:56:29 UTC
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
Comment 20 Jorge Urdaneta 2008-09-11 15:56:20 UTC
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
Comment 21 Richard Schwarting 2009-11-02 00:54:09 UTC
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.
Comment 22 Richard Schwarting 2009-11-02 03:34:14 UTC
Created attachment 146716 [details] [review]
Patch adding AtomBlogger support

Fixes a couple deprecation warnings and stuff.
Comment 23 Olav Vitters 2009-11-04 12:39:42 UTC
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.
Comment 24 Richard Schwarting 2010-03-04 18:48:57 UTC
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?
Comment 25 Olav Vitters 2010-03-04 19:14:28 UTC
I used patch, not git.
Comment 26 Richard Schwarting 2010-03-04 19:53:35 UTC
Thanks for responding :)  Sorry for failing to test it properly at the time.
Comment 27 Tommi Asiala 2010-03-06 08:41:00 UTC


  • File "/usr/lib/python2.6/dist-packages/gnomeblog/atomBloggerAPI.py", line 2 in <module>
    import atom
ImportError: No module named atom

Another missing file or am I just unable to find that module with Ubuntu 9.10?
Comment 28 Richard Schwarting 2010-03-08 17:50:09 UTC
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.
Comment 29 Olav Vitters 2010-03-08 18:09:17 UTC
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.
Comment 30 Richard Schwarting 2010-03-08 19:16:57 UTC
Ah, thanks.  I'll open a new one once I have a patch.