Our great sponsors
-
Puts Debuggerer
Ruby library for improved puts debugging, automatically displaying bonus useful information such as source line number and source code.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
# -*- coding: utf-8 -*- # u/Author: CriseLYJ # u/Date: 2020-08-14 12:13:11 import re import requests from getpass import getpass class GithubLogin(object): def __init__(self, email, password): # 初始化信息 self.headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36', 'Referer': 'https://github.com/', 'Host': 'github.com' } self.session = requests.Session() self.login_url = 'https://github.com/login' self.post_url = 'https://github.com/session' self.email = email self.password = password def login_GitHub(self): # 登录入口 post_data = { 'commit': 'Sign in', 'utf8': '✓', 'authenticity_token': self.get_token(), 'login': self.email, 'password': self.password } resp = self.session.post( self.post_url, data=post_data, headers=self.headers)