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.



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?
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
The documentation block in the script hasn’t been updated to reflect the Plurk password.
Would be cool to (perhaps optionally) prevent reply tweets from synching to Plurk.
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.
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.
[...] Adams has posted a Python script that does exactly that, posting your tweets as plurks and your plurks as tweets. I have [...]
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
Thanks for the info! I’ll add the credit for Neville to the code and update my post.
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.
[...] Plurk your tweets [...]
‘TimeLine/addPlurk’ call now needs one more additional parameter.
This parameter is ‘uid’, and the value is, as expected, the user_id of the Plurk User that is posting the Plurk.