Main
Latest
- Muti API Updates
- Today's Stupid Idea: Plurk Karma
- Plurk PHP Post Script
- Optimus Microformats Parser
- XFN Discovery
- Google Social Graph API
- ISDSL Stats
- Twitter Pwned Again
- Jabber ID Change
- charlvn.za.net downtime
Archives
- June 2004
- July 2004
- August 2004
- September 2004
- October 2004
- November 2004
- December 2004
- January 2005
- February 2005
- March 2005
- April 2005
- May 2005
- June 2005
- July 2005
- August 2005
- September 2005
- October 2005
- November 2005
- December 2005
- January 2006
- February 2006
- March 2006
- April 2006
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- November 2006
- December 2006
- January 2007
- February 2007
- March 2007
- April 2007
- May 2007
- June 2007
- July 2007
- August 2007
- September 2007
- October 2007
- November 2007
- December 2007
- January 2008
- February 2008
- March 2008
- April 2008
- May 2008
- June 2008
- July 2008
- August 2008
- September 2008
- October 2008
Plurk Python Post Script
Neville Newey of muti wrote the following Python script similar in function to the PHP script I wrote a bit earlier today. Essentially it lets you post a new message to your plurk account.
import urllib
import urllib2
import cookielib
# Based on Charl VN's PHP Code
PLURK_LOGIN_URL = 'http://www.plurk.com/Users/login'
PLURK_ADD_URL = 'http://www.plurk.com/TimeLine/addPlurk'
NICKNAME = 'yourname'
PASSWORD = 'secret'
if __name__ == '__main__':
# Set up
jar = cookielib.CookieJar()
handler = urllib2.HTTPCookieProcessor(jar)
opener = urllib2.build_opener(handler)
# Login phase ...
url = PLURK_LOGIN_URL
values = { 'nick_name': NICKNAME, 'password': PASSWORD }
data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = opener.open(req)
# Now plurk something!
values = {'content': 'Plurking from Python!', 'lang':'en', 'no_comments':'0'}
data = urllib.urlencode(values)
data+='&qualifier=%3A' # Dont know if this is needed
url = PLURK_ADD_URL
req = urllib2.Request(url, data)
response = opener.open(req)
print response.read()
This is the base for a new hook script so that you can now follow muti on plurk!
Copyright © 2004-2008 Charl van Niekerk. All articles are released under the Creative Commons Attribution 2.5 South Africa licence, unless where otherwise stated.


5 Comments
Comment by
Jason M. Adams on Friday, June 06, 2008 6:10:00 AM
Good work on that snippet! I incorporated it into my plurks-to-tweets code so that now you can synchronize your twitter and plurk accounts: http://mendicantbug.com/2008/06/06/plurk-your-tweets/
Comment by
Jason M. Adams on Friday, June 06, 2008 6:10:00 AM
Woops, the clickable link:
Comment by
Charl van Niekerk on Saturday, June 07, 2008 4:02:00 PM
Cool thanks man. I will check your script out some time as soon as I have a few minutes.
Comment by
wow gold on Monday, June 09, 2008 3:43:00 AM
WOW Gold - wow gold - wow gold online kaufen bei .wow gold..kz
Comment by
David Blume on Monday, July 14, 2008 8:34:00 PM
There's a Python port of the Unofficial Plurk API being made over at Google Code.
http://code.google.com/p/plurkapipy/
Post a Comment