Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- #----------------------------------------------------------------------
- def login(username, password):
- """logs into reddit, saves cookie"""
- print 'begin log in'
- #username and password
- UP = {'user': username, 'passwd': password, 'api_type': 'json',}
- #POST with user/pwd
- r = requests.post('http://www.reddit.com/api/login', data=UP)
- #read this to make sure no errors
- print r.text
- login('USERNAMEHERE', 'PASSWORDHERE')
Add Comment
Please, Sign In to add comment