<commit_before>#!/bin/env python
# -*- coding : utf-8 -*-

import requests,re

username = ''      
password = ''    
login_url = 'http://v2ex.com/signin'
home_url = 'http://www.v2ex.com'
mission_url = 'http://www.v2ex.com/mission/daily'


UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36"

headers = {
        "User-Agent" : UA,
        "Host" : "www.v2ex.com",
        "Referer" : "https://www.v2ex.com/signin",
        "Origin" : "https://www.v2ex.com"
        }


def main():
  s = requests.session()
  d = {'u':username,'p':password,'next':'/'}
  page1 = s.get(login_url,headers=headers).text
  once1 = re.search(r'<input type="hidden" value="([0-9]+)" name="once" />',page1).group(1)
  d['once'] = once1
  s.post(login_url,data=d,headers=headers)
  page2 = s.get(mission_url,headers=headers).text
  once2 = re.search(r'/mission/daily/redeem\?once=[0-9]+',page2).group(0)
  sign_url = home_url + once2
  page3 = s.get(sign_url,headers=headers).text


if __name__ == '__main__':
  main()<commit_msg>rewrite code and change to https<commit_after>#!/bin/env python
# -*- coding : utf-8 -*-


import requests,re

username = ''      
password = ''    
login_url = 'https://v2ex.com/signin'
home_url = 'https://www.v2ex.com'
mission_url = 'https://www.v2ex.com/mission/daily'


UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36"

headers = {
        "User-Agent" : UA,
        "Host" : "www.v2ex.com",
        "Referer" : "https://www.v2ex.com/signin",
        "Origin" : "https://www.v2ex.com"
        }


def main():
  s = requests.session()
  d =  {'next':'/'}  

  page1 = s.get(login_url,headers=headers).text
  once1 = re.search(r'<input type="hidden" value="([0-9]+)" name="once" />',page1).group(1)
  d['once'] = once1
  
  name_code =  re.search(r'input type="text" class="sl" name="([0-9a-z]+)"',page1).group(1)
  pwd_code  =  re.search(r'input type="password" class="sl" name="([0-9a-z]+)"',page1).group(1)
  d[name_code] =  username
  d[pwd_code]  =  password
  s.post(login_url,data=d,headers=headers)

  page2 = s.get(mission_url,headers=headers).text
  once2 = re.search(r'/mission/daily/redeem\?once=[0-9]+',page2).group(0)
  sign_url = home_url + once2
  #sign
  page3 = s.get(sign_url,headers=headers).text
  print 'finished!'



if __name__ == '__main__':
  main()

{'fraction_non_alphanumeric': 0.20270824784571195, 'fraction_numerical': 0.04267542059909725, 'mean_word_length': 3.4816176470588234, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 7, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4161724', 'n_tokens_mistral': 1042, 'n_tokens_neox': 989, 'n_words': 155}