Create cm2cron.py

This commit is contained in:
tianyu 2015-06-01 15:23:08 +08:00
parent 63dda50e1a
commit f9cab1b1a6
1 changed files with 19 additions and 0 deletions

19
net/cm2cron.py Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env python
from bs4 import BeautifulSoup
import urllib2
url = 'https://download.cyanogenmod.org/'
soup = BeautifulSoup(urllib2.urlopen(url))
tag = soup.find_all('span')
count = 0
for span in tag:
if span.get('class')[0] == "codename":
print str(count) + " * * * * bash /root/bin/cm " + span.string
count += 2
if count == 60:
count = 0