File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 32
32
** 最后:** ` python github_bot.py `
33
33
34
34
## 开发日志
35
+ #### 2016-9-29
36
+ - Github今日热点项目不统计自己的项目
37
+ - 错误日志放到脚本的同目录下
38
+
35
39
#### 2016-9-24
36
40
实现根据star数量,从高到低展示。
37
41
#### 2016-9-5
41
45
42
46
1 . 获取explore页的数据
43
47
2 . 异步请求获取star数
48
+ 3 . 自己项目的数据统计
Original file line number Diff line number Diff line change 17
17
18
18
logging .basicConfig (
19
19
level = logging .WARNING ,
20
- filename = os .path .join (os .getcwd ( ), 'bot_log.txt' ),
20
+ filename = os .path .join (os .path . dirname ( __file__ ), 'bot_log.txt' ),
21
21
filemode = 'a' ,
22
22
format = '%(name)s %(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s'
23
23
)
@@ -92,7 +92,9 @@ def check_condition(data):
92
92
date_condition = create_time >= (datetime .datetime .now ()
93
93
- datetime .timedelta (days = DAY ))
94
94
if (data ['type' ] == 'WatchEvent' ) and date_condition :
95
- if data ['payload' ]['action' ] == 'started' :
95
+ # 不统计自己项目的star事件
96
+ if data ['payload' ]['action' ] == 'started' and \
97
+ ACCOUNT ['username' ] not in data ['repo' ]['name' ]:
96
98
data ['date_time' ] = create_time .strftime ("%Y-%m-%d %H:%M:%S" )
97
99
return True
98
100
else :
You can’t perform that action at this time.
0 commit comments