Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 15th, 2012  |  syntax: None  |  size: 1.17 KB  |  views: 1,180  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import requests
  2.  
  3. # Login URL - https://instagram.com/accounts/login/?next=/accounts/edit/
  4. # Reg URL - http://instagram.com/api/v1/push/register/?platform=7&device_type=ios
  5. # Mass Follow URL - http://instagram.com/api/v1/friendships/create_many/
  6.  
  7. def login():
  8.     # Assign headers
  9.     txheaders =  {'User-agent' : 'Instagram 2.5.0 (iPad; iPhone OS 5.1.1; en_GB)'}
  10.  
  11.     # Assign url to pass (login url in this case)
  12.     url = 'https://instagram.com/accounts/login/?next=/accounts/edit/'
  13.  
  14.     # Assign cookies to use to spoof login
  15.     cookies = {
  16.         '__utma': '1.238572629.1342045326.1342081337.1342110446.5',
  17.         '__utmb': '1.5.10.1342110446',
  18.         '__utmc': '1',
  19.         '__utmz': '1.1342045326.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
  20.         'sessionid': 'IGSC3c2639fb6d884686ec61a50ec677a1ddc16723e20d133dc939e2373bf08efcb4%3ASt4Ep2OMixSHmlT1OF043U7yT15gPsqE%3A%7B%7D',
  21.         'csrftoken': 'XXXXXXX',
  22.         'ds_user_id': 'XXXXXXX'
  23.     }
  24.  
  25.     # Request url with cookies, headers, and redirects enabled.
  26.     r = requests.get(url, cookies=cookies, headers=txheaders, allow_redirects=True)
  27.  
  28.     # Show the page source
  29.     print r.text
  30.  
  31.  
  32. login()
clone this paste RAW Paste Data