Created
April 3, 2013 18:59
-
-
Save toomore/5304195 to your computer and use it in GitHub Desktop.
睡覺前練習一下看看噗浪有沒有什麼改變 ... 好像沒有
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests | |
import re | |
import sys | |
if __name__ == '__main__': | |
''' How to use. | |
python ./plurkbot.py {username} {password} {saysomething} | |
''' | |
s = requests.Session() | |
r = s.post( | |
'https://www.plurk.com/Users/login', | |
verify = True, | |
data= | |
{ | |
'nick_name': sys.argv[1], | |
'password': sys.argv[2], | |
'logintoken': 1} | |
) | |
uid = re.search('\"user_id\": ([0-9]+),', r.content).group(1) | |
s.post( | |
'http://www.plurk.com/TimeLine/addPlurk', | |
cookies=r.cookies, | |
data={ | |
'uid': uid, | |
'content': sys.argv[3], | |
'qualifier': ':' | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment