Put your latest tweet as Pidgin’s status on Ubuntu (Linux)

Tuesday, December 22nd 2009, 01:27

Twitter became a trend nowadays when almost everything important is being found out via this social-networking micro-blogging service. And now with Google’s real time search-results that includes tweets too, Twitter is recognised as a powerful platform by even the Internet’s giant. Since your (and mine too) online presence might include a few tweets a day, in a moment of total boredom, I decided to write a simple Python script that would update your Pidgin’s status with the latest tweet from your account.

Using the same principle as the script I wrote for updating Pidgin’s status with a random post from your blog’s feed, this new script uses as well a feed (the one provided by Twitter to every user), only that this time only the latest tweet will be set as status. Replies are ignored and therefore if your latest Twitter interaction is a reply, the script will search for the latest tweet which is doh not a reply. Because hash-tags represented a problem when trying to set Pidgin’s status the hash signs (#) are eliminated.

To properly use the script, the following steps should be followed:

  1. download the script from here and save it to your ~/bin directory (if the directory doesn’t exist, create it)
  2. make it executable
    chmod +x twitterize_pidgin_status.py
  3. setting your DBUS session parameters requires exporting some variables to your environment. Download this script to the same ~/bin directory, make it executable and add it via System – Preferences – Startup Applications to the list of programs that start at log in. This way you’ll always be sure the needed variables are available;
  4. edit your crontab to make the script check for updates as often as you wish (every 5 minutes in this example)
    SHELL=/bin/bash
    DISPLAY=:0.0
    */5 * * * * source ~/.Xdbus; ~/bin/twitterize_pidgin_status.py your_twitter_feed
    

Now the only thing that remains to do is to tweet. Have fun!

Similar Posts:

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">


CODE EXAMPLES: When you want to include source code or terminal output, please use the the following tags like in the next example:

    [language]
    code lines
    [/language]
	

where you substitute language with the programming laguage used throught the code example (for terminal output that would be bash), e.g:

    [bash]
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    [/bash]
	

To see a list of all the supported languages, please check this page.

If you want to include code bits inline, please use the code tags like in the following example:

    The <code>$USER</code> variable holds the current logged in username.
	

Secure your files

Dropbox

Recent Comments

  • Radu said:
    I think you have a corrupted archive. Try to download it again. more»
  • Ronny Ko said:
    I have a gigabit Dlink card ( D-Link System Inc DGE-530T Gigabit Ethernet Adapter (rev 11) (rev 11)). When I first run... more»
  • al.zatv said:
    Calin, thank you for your info. web face for virtualbox is the thing i was looking for. more»
  • djrise said:
    Hi and thank you for your job, I have downloaded the script but when i execute them it said : sh vmware-server-2.0.x-kernel-... more»
  • Xr said:
    Disabling vmci in the web access solved it: Select the VM–>ConfigurationR 11;>Advanced–>Conf iguration... more»

Recent Tweets

Geek blogs

Bear