Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: Python,authenticate, Created At: 10/24/2016 8:06:58 PMViews:

HTML view:
Copy Source | Copy HTML
  1. def authenticate(self):
  2.     content = 'filled=yes&timestamp={0}&idkey={1}&no=%D0%9D%D0%B5%D1%82'
  3.     content = content.format(self.timestamp(), self._idkey)
  4.  
  5.     connection = httplib.HTTPConnection('passport.yandex.ru')
  6.     connection.request('POST', '/passport?mode=auth', content, {'Cookie': self.getcookies()})
  7.  
  8.     response = connection.getresponse()
  9.     cookies = response.getheader('set-cookie', None)
  10.  
  11.     ... парсинг кук регекспами ...
  12.  
  13.     response.close()

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018