A couple of days ago, I wrote a script that would tweet anything you plurked. Thanks to some code from Neville Newey (based on PHP code by Charl van Niekerk), the plurk.py script I wrote has been updated to both plurk your tweets and tweet your plurks. This should work on both windows and linux machines. If you have access to a linux machine, I suggest setting up a cron job to take care of this. As I mentioned in the previous post, if you set up a cron job, be sure to change the path to plurkdb.dat to an absolute path. I have done the most testing on this with python 2.4 in linux.
This code is open source under the Creative Commons 3.0 Attribution license that this blog uses Creative Commons BSD license. Neville’s code appears to be under CC:Attribution 2.5 for South Africa, by what I could glean from his site. I have considered making this an open source project under Google code but have yet to take it all the way. Google sets a lifetime limit of 10 projects, so I will continue to hoard those against future need. If you make modifications to the code, please let me know and I will probably post them here and in the code for future releases, so we all win.
Note that the command line parameters have changed:
plurk.py <twitter username> <twitter password> <plurk username> <plurk password>
And of course, as with all software, use at your own risk.




10 comments
Comments feed for this article
6 June 2008 at 13:18:00
PythonNewbie
Just checked with my host and python is installed. No clue what to do with this script though. Where do I define my usernames/pws? Do I create an empty plurkdb.dat for this script to store and reference status messages?
6 June 2008 at 13:37:19
Jason Adams
It will create the plurkdb.dat file for you automatically. You just need to pass the usernames and passwords on the command line when you run it. If you are just running it manually, then you can just type:
python plurk.py twitter_username twitter_passwd plurk_username plurk_passwd
If you know where python is installed on your server (usually by typing “which python”) and you’re running linux, you can change the first line of the script to that path. If you are running windows, run it from the command line like I just said.
If you are setting it up as a cron job in linux, edit the script and change the path to the plurkdb.dat file to the path you want it to be stored. This might be like “/home/your_username/plurkdb.dat”. Also if you’re running a cronjob you might need to run python on the script manually. An example cron job might look like this:
*/10 * * * * /usr/bin/python /home/your_username/plurk.py twitter_username twitter_passwd plurk_username plurk_passwd
7 June 2008 at 06:15:52
Steve Crane
The documentation block in the script hasn’t been updated to reflect the Plurk password.
7 June 2008 at 06:24:55
Steve Crane
Would be cool to (perhaps optionally) prevent reply tweets from synching to Plurk.
7 June 2008 at 11:12:45
Jason Adams
Good idea. I’ll add that and fix the documentation. I’m thinking of also moving it to a CC:BSD license, since that makes more sense for software.
7 June 2008 at 14:16:39
Jason Adams
The code has been updated. Now you can pass the final parameter as -t or -p to either only update twitter (-t) or plurk (-p).
ex.
./plurk.py twuser twpass pluser plpass -twill tweet just your plurks.
7 June 2008 at 16:45:58
How to synchronise your plurks and tweets « craniac’s place
[...] Adams has posted a Python script that does exactly that, posting your tweets as plurks and your plurks as tweets. I have [...]
7 June 2008 at 21:57:07
Charl van Niekerk
Hi Jason,
Thanks for building on the code, really cool to see somebody got some benefit out of it! The Python version of the code has actually not been written by me, credit for that goes to Neville Newey. All the best with the Python hacking though!
Cheers,
Charl
8 June 2008 at 08:47:20
Jason Adams
Thanks for the info! I’ll add the credit for Neville to the code and update my post.
14 July 2008 at 15:30:12
David
Ryan’s Unofficial Plurk API is being ported to Python over at Google Code.
http://code.google.com/p/plurkapipy/
As a project, it’s just starting. But at least you don’t have to burn one of your Google Code allotments on it.