-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoFlowLeakerClient2.py
54 lines (41 loc) · 1.05 KB
/
AutoFlowLeakerClient2.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-01-04 19:15:29
# @Author : Tom Hu ([email protected])
# @Link : http://h1994st.com
# @Version : 1.0
import json
import time
from Ghost import Ghost
from Github import Github
# Ghost (?) -> Wordpress (covertsan.wordpress.com)
# Github (covertsan) <- Evernote (ctom357)
sender = Ghost()
receiver = Github()
print 'Run'
print 'Clear all'
sender.delete_all_posts()
receiver.clean()
print '-----------'
query = 'basketball'
results = []
# while True:
for i in xrange(10):
print 'Round', i
# Send
sender.create_issue(str(time.time()), query)
print 'Send:', query
start = time.time()
res = receiver.issues
while len(res) == 0:
# print 'Nothing, sleep 5 seconds'
print 'Sleep 5 seconds'
time.sleep(5)
res = receiver.issues
end = time.time()
print 'Time:', end - start
results.append(end - start)
receiver.clean()
filename = 'twitter_%d.json' % (int(time.time()))
with open('data/%s' % filename) as fp:
json.dump(results, fp)