forked from kk98kk0/sec_profile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_daily.py
57 lines (38 loc) · 963 Bytes
/
update_daily.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
import os
import sys
reload(sys)
sys.setdefaultencoding('utf8')
from secwiki_today import scraw as secwiki_scraw
from xuanwu_today import scraw as xuanwu_scraw
import secwiki as secwiki
from mills import SQLiteOper
from mills import get_special_date
import visual
def scraw(proxy=None):
"""
:return:
"""
so = SQLiteOper("data/scrap.db")
secwiki_scraw(so, proxy=proxy, delta=10)
xuanwu_scraw(so, proxy=proxy, delta=10)
def update_github():
"""
:return:
"""
ts = get_special_date(format="%Y-%m-%d %H:%m:%S")
cmd = "git add . && git commit -m '%s' && git push origin master" % (ts)
ret = os.system(cmd)
if ret != 0:
print("%s failed" % cmd)
if __name__ == "__main__":
"""
"""
proxy = {
"socks:": "socks://127.0.0.1:8420",
}
proxy = None
scraw(proxy=proxy)
visual.draw_readme()
secwiki.main(renew=False)
update_github()