Created
July 13, 2017 06:09
-
-
Save cosysn/afc518f5ade73f7914b820f2ae344e6d to your computer and use it in GitHub Desktop.
能够自动在readfree网站上签到的脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import logging | |
url='http://readfree.me/accounts/checkin' | |
cookie_str='' # 需要登录到readfree上获取当时的cookie值,然后直接使用该cookie值进行登录签到 | |
logging.basicConfig(level=logging.INFO, | |
filename='/var/log/readfree_auto_sig.log', | |
filemode='a', | |
format='%(asctime)s - [line:%(lineno)d] - %(levelname)s: %(message)s') | |
if __name__ == "__main__": | |
cookies={} | |
for ck in cookie_str.split(';'): | |
name,value=ck.strip().split('=',1) | |
cookies[name]=value | |
logging.info('start to sign ...') | |
ret=requests.get(url, cookies=cookies) | |
logging.info('sign %s'%ret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment