You are not logged in.

#1 2010-05-03 05:15:41

mDuo13
Member
Registered: 2010-04-25
Posts: 93

Extremely minimal Twitter client (v2, now with OAuth Support)

So after giving up on getting Twitux to work, I decided to create my own, ultra-minimal Twitter client with PyGTK. Right now the only feature is the ability to post to your status, but thanks to the python-twitter library, I can probably add more features easily enough. (I'm considering adding the ability to show your timeline in Conky.)

UPDATE September 6, 2010:
I've updated this to use OAuth. The changes:
- You no longer need to keep your Twitter username and password in a plaintext file
- Uses the Tweepy library instead of python-twitter
- The first time you run the program, you should run it in console and go through the "OAuth Dance" to authorize the app to access your Twitter account.
- Upon getting errors from Twitter, it will display an error message and quit instead of waiting unhelpfully for you to give up and press ESC.

Screenshot:
tweet.jpg

Dependencies:
Python
PyGTK (pacman -S pygtk)
python-simplejson (pacman-S python-simplejson)
python-twitter (link) (No longer needed.)
tweepy-git (AUR)

Installation (Fresh):
1. Download tweet.py and mainwin.glade files.
2. Make sure you have the required dependencies (listed above). Put the mainwin.glade file some folder of your choice (doesn't need to be the same folder as the tweet.py file)
3. Edit the file tweet.py and change the "CONFDIR" parameter to be the directory where you put the glade and conf files.
4. Run tweet.py from console at least once. It'll give you a URL to visit. Go there, click "Allow" and enter the PIN it provides back into the console.
5. (Optional) Set a keyboard shortcut to tweet.py, for example in my Openbox conf file:

    <keybind key="W-s">
      <action name="Execute">
        <command>python /home/mduo13/bin/tweet.py</command>
      </action>
    </keybind>

Upgrading from version 1:
1. Download the new tweet.py file and overwrite the existing one.
2. Instally Tweepy (the other dependencies remain the same)
3. Run tweet.py from console at least once. It'll give you a URL to visit. Go there, click "Allow" and enter the PIN it provides back into the console.
4. (Optional) Edit the tweet.conf file and remove the lines with your username and password.
5. (Optional) Remove the python-twitter package since it's not needed anymore.

Usage:

python tweet.py

A small window appears. Input your tweet. Press Enter to send to Twitter, Escape to close the program without sending.

That's all.

Last edited by mDuo13 (2010-09-06 19:49:23)

Offline

#2 2010-05-03 05:35:05

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Extremely minimal Twitter client (v2, now with OAuth Support)

Awesome! I'll try it out and see how it goes

EDIT: Woah, what I just noticed is pretty freaky:

Before I edited tweet.py, I decided to keep the glade file in .config/tweet.....same as you yikes

EDIT EDIT: Just tested, it works! big_smile

EDIT EDIT EDIT:
I made a script named "tweet" with the following:

#!/bin/sh
python /home/brad/scripts/tweet.py

I chmod'd it up and copied it to /usr/bin

Last edited by cesura (2010-05-03 05:43:49)

Offline

#3 2010-05-03 06:33:56

mDuo13
Member
Registered: 2010-04-25
Posts: 93

Re: Extremely minimal Twitter client (v2, now with OAuth Support)

Nice, glad to know you like it.

Offline

#4 2010-05-03 06:57:17

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Extremely minimal Twitter client (v2, now with OAuth Support)

I've already got three...

tircd (with irssi), ttytter, and a tweet function in my .zshrc.

Offline

#5 2010-09-06 18:40:18

mDuo13
Member
Registered: 2010-04-25
Posts: 93

Re: Extremely minimal Twitter client (v2, now with OAuth Support)

A few days ago, Twitter finally disabled Basic Auth for the API. As such, this client stopped working. I've updated it to use OAuth, but I'm still retracing my steps to make it doing the OAuth dance a repeatable step...

EDIT: Alright, done. Updating the first post with the new version... done.

Last edited by mDuo13 (2010-09-06 19:49:46)

Offline

Board footer

Powered by FluxBB