Wednesday, May 12, 2010

Gwibber on Ubuntu 10.04 LTS

While playing with the new Ubuntu 10.04 LTS, I saw the Gwibber client for Twitter, Facebook, Digg, Flickr and others. I know this has not much to do with WebCenter, Enterprise 2.0, Fusion, or even Oracle, but just would like to share in case you read my earlier post and decided to use Ubuntu 10.04.

I tried to make it work, so I could just see the tweets popping up on the desktop via notification-applet, but the first tries were frustrating...
I did manage to add my twitter account, but no updates would come. Facebook was even worst, as I could not even add the account.

After spending some time searching around, I found this bug #530195, where the comment #22 suggested that you increased the timeout in network.py.

I opened up  /usr/lib/python2.6/dist-packages/gwibber/microblog/network.py and noticed the original connection timeout was set to 8secs.

Not sure what internet provider people are using, and I actually thought I had a good speed (around 20Mbps), but that was still not enough. I'm also not sure about the DNS tricks (openDNS + google DNS = magic DNS :), so I just went the lazy way -- multiply by 10 :)

#/usr/lib/python2.6/dist-packages/gwibber/microblog/network.py

    self.curl.setopt(pycurl.TIMEOUT, 150)
    self.curl.setopt(pycurl.CONNECTTIMEOUT, 80)

That solved the Twitter problem, but I was still not able to add my account to Facebook.
After some more research, I found another bug #552227, with many suggestions on how to overcome that. I tried all the suggestions on that page but still no luck.

Ok, let's try the "twitter-hack" then :)... Found that there connection timeout was actually being set on another file -- /usr/lib/python2.6/dist-packages/gwibber/microblog/util/facelib.py

I again applied the "lazy 10x higher" fix:
#/usr/lib/python2.6/dist-packages/gwibber/microblog/util/facelib.py

    c.setopt(pycurl.TIMEOUT, 150)
    c.setopt(pycurl.CONNECTTIMEOUT, 80)

Yay! Finally able to see both Twitter and Facebook accounts on Gwibber! And the cool desktop icon notifications keep popping up now,  a quick not-that-intrusive way to keep updated on things. I really like it better than having either  an extra browser window, or another application running.

3 comments:

  1. Thank you that did the trick for me. It looks like they definitely made the timeout times too short. It also explains why some people with slow dns servers finally get it to work by moving to a faster dns server but the real issue is that these time out times are just too short for many locations. Found the twitter config file at: /usr/share/pyshared/gwibber/microblog/network.py

    ReplyDelete
  2. Worked for me too, thank you so much!

    ReplyDelete
  3. today's auto update on Ubuntu 10.04 contains the gwibber patch version 2.30.1-0ubuntu1 with my suggestion in it :-)

    See the release notes:
    - All of these fixes are related to reducing the number of calls we we make to facebook and reducing the size of the result. Facebook throttles application wide, not per-user based on usage. This throttling is the root cause for (LP: #552227) and (LP: #595265) and probably many other bug reports where facebook rejects gwibber.
    - Merged in the latest version of facelib.py
    - Don't fail when we get valid error codes back from facebook, log them.
    - Bump the map_async timeout up to make sure it is higher than the pycurl timeouts
    - Bump the pycurl.TIMEOUT to 150 and use default for pycurl.CONNECTTIMEOUT

    ReplyDelete