Skip to content

Instantly share code, notes, and snippets.

@toomore
Created April 3, 2013 18:59
Show Gist options
  • Save toomore/5304195 to your computer and use it in GitHub Desktop.
Save toomore/5304195 to your computer and use it in GitHub Desktop.
睡覺前練習一下看看噗浪有沒有什麼改變 ... 好像沒有
#!/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