forked from blackgear/ingrex_lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomm.py
More file actions
29 lines (25 loc) · 666 Bytes
/
Copy pathcomm.py
File metadata and controls
29 lines (25 loc) · 666 Bytes
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
"COMM monitor"
import ingrex
import time
def main():
"main function"
field = {
'minLngE6':116298171,
'minLatE6':39986831,
'maxLngE6':116311303,
'maxLatE6':39990941,
}
with open('cookies') as cookies:
cookies = cookies.read().strip()
mints = -1
while True:
intel = ingrex.Intel(cookies, field)
result = intel.fetch_msg(mints)
if result:
mints = result[0][1] + 1
for item in result[::-1]:
message = ingrex.Message(item)
print(u'{} {}'.format(message.time, message.text))
time.sleep(10)
if __name__ == '__main__':
main()