forked from xjr7670/QQzone_crawler
-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
44 lines (36 loc) · 1.32 KB
/
main.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
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
import get_my_friends
import get_moods
import get_qq_number
import operate_table
import sys
import get_moods_detail
if __name__ == '__main__':
#Create database
operate_table_obj = operate_table.Operate_table()
operate_table_obj.create_table()
#If is given qq number, just run with
#this qq number
argv = sys.argv
if len(argv) > 1:
qq = argv[1]
with open('qqnumber.inc', 'w') as qqfile:
qqnumber_item = [{'data': qq, 'label': "Null"}]
qqfile.write(str(qqnumber_item))
else:
# First, we need to get all our qq friends data
get_friends_obj = get_my_friends.Get_friends_number()
get_friends_obj.get_friends()
# Second, deal with this data, clean it
# From the get_friends result get the useful data
# And save it to file qqnumber.inc
# The format of this file just a list
get_qq_item_obj = get_qq_number.exact_data_from_result()
get_qq_item_obj.exact_qq_number()
# Finally, use the cleaned data to get mood
# Base on last step's qqnumber.inc file
# exact the qq number and start to get their moods
# 最后,根据每一个QQ号码去获取对应的动态
get_moods_obj = get_moods.Get_moods_start()
get_moods_obj.get_moods_start()