The first CONKY TWITTER CLIENT ZOMG!

Well, I can’t really say that it’s the first conky twitter client. Any twitter client from cli should be able to work. But I can say that this is something that I am very proud of it because I MADE IT!!!

In order to get this on your sexy conky configuration, you are going to have to jump through some hoops. So bear with me.

First up is to install python-twitter.

sudo apt-get install python-twitter

Now that wasn’t so bad was it?

Now we are going to have to edit your conky configuration.

put “text_buffer_size 10000” (no quotes) into your ~.conkyrc file. This allows conky to display more text than normally. Make sure that it goes before TEXT.

now download the script, or copy and paste for your enjoyment.


''''This piece o' junk hack of python and twitter was created by
Travis Moore (@travist120). Some 17 year old kid who decided that he
was severely bored one day and decided to create this instead of doing
his Essay and french homework.
'''





'''Oh, and the licence. I have to make sure that those who copy will
give back.'''

'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see
.

'''

import os
import string
import twitter
#set your user name and password here.
username=''
password=''

api = twitter.Api(username, password)
status = api.GetFriendsTimeline()
#how many tweets you want displayed at a time
twitterSize = 5;
i = 0
for s in status:
i = i+1
print s.user.name, "(@"+s.user.screen_name+")"
print s.text
print
if i == twitterSize:
break


Make sure that if you copy and paste it, you name it cwitter.py.

Now to make it show up in conky.

${execi 60 python ~cwitter.py | fold -w45}

stick that under your TEXT and you are done. I have set the time (60 seconds) as default because it’s nice and safe on Twitter’s servers. Feel free to change that.

-w45 might also need to be changed. This is the word wrap settings, so you are going to have to manually figure that one out by trial and error.

Advertisements

3 Responses to “The first CONKY TWITTER CLIENT ZOMG!”


  1. 1 Vedang July 4, 2009 at 3:46 pm

    awesome dude! Thanks for a superb script. It was the last bit I wanted for my conky-setup, and I think I’ve used it well. You might want to take a look: http://mytechrants.wordpress.com/2009/07/04/console-junkie-conky-makes-your-desktop-awesome/

  2. 2 Dan November 27, 2009 at 11:09 pm

    Hi,
    just for those who are looking for this setting and struggling with following error :
    File “/home/dan/Source/scripts/conky/ctwitter.py”, line 16, in
    print s.user.name, “(@”+s.user.screen_name+”)”.encode(“utf-8”)
    UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\xe9′ in position 1: ordinal not in range(128)

    add .encode(“utf-8”) after each variable.
    change the ctwitter.py to
    print s.user.name.encode(“utf-8”), “(@”+s.user.screen_name+”)”.encode(“utf-8”)
    print s.text.encode(“utf-8”)

    Otherwise conky will not display the tweets if they (or the name) contains any non-ascii character.

    You might also add override_utf_locale yes to the conkyrc.

    Hope this helps anyone having same problem.


  1. 1 Console Junkie: Conky Makes Your Desktop Awesome! « Tech Rants Trackback on July 4, 2009 at 3:25 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




@Travist120

Error: Twitter did not respond. Please wait a few minutes and refresh this page.


%d bloggers like this: