As we all know, there are infinite sites, especially bbs, have a sign-in mechanism to keep users. Usually, there are some resources, mostly downloadable at a cost of some points by consecutive signs. Hence, many will face a problem that the points are insufficient from time to time, because few people can keep active on those sites frequently. Therefore, it is natural to write a script to sign-in automatically and daily through crontab features. I respect all the sites as well as their benefits, and I understand maintain a website need dedication and money, so this passage is just for learning and fun, instead of a battlecry towards them.
Python is a popular language in recent years (See TIOBE Index) with fabulous features. Almost every Linux distribution preloaded Python. A convulted problem is there are Python2 and Python3 parralleling and not comaptible with each other. Apparently, Python3 is the latest version substantially, however, Python2 is supported until 2020 according to Python developers. As a researcher, learning new things is an essential ability. Hence, I am trying to get used to Python3. Thanks to 2to3 and the documents, I've translated my original Python2 code to Python3, so in this passage all codes are in Python3!
We need import urllib, urllib2, cookielib and re.