-
Notifications
You must be signed in to change notification settings - Fork 157
Voting
YES GOT IT TO WORK!!!!!!
1. Login using HTTP POST:
POST /api/login/talklittle_test HTTP/1.1
Host: www.reddit.com
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 34
user=talklittle_test&passwd=apple1
2. Get the Cookie returned by successful login. “reddit_session”
3. GET any regular HTML page, including the cookie in the request.
a. /stats is a good short page
4. Within the first 1200 characters is the string:
/* the user’s voting hash */ modhash: ‘0n8brzh8gmb4d96eca66427fa22864f4950c3011ea218623ce’
5. GET a .json file if you want, don’t worry, the modhash will not be overwritten unless even if you do HTML
6. POST to /api/vote:
POST /api/vote HTTP/1.1
Host: www.reddit.com
Cookie: reddit_session=5998378%2C2009-08-02T20%3A42%3A13%2C88d228b9e8b544eb4a55e79306c12f9245572b0e; Domain=reddit.com; Path=/
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 81
id=t1_c0bmiqy&dir=1&r=TRUST&uh=rrpxi78fgxe7af6048f6181ec2180de12b9094c505be8a933c
7. If you get error “USER_REQUIRED” returned, then the modhash is invalidated. You don’t have to re-login. Just do a GET on some page, with the same cookie, and get the new modhash. Easy!