-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (24 loc) · 818 Bytes
/
main.py
File metadata and controls
32 lines (24 loc) · 818 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
30
31
32
import ConfigParser
import pickle
from netflix import connection as n_connection
from netflix import parser as n_parser
def main():
config = ConfigParser.SafeConfigParser()
config.read('config')
email = config.get('netflix_parser', 'email')
password = config.get('netflix_parser', 'password')
n_conn = n_connection.NetflixConnection(email, password)
n_conn.login()
viewing_data = n_conn.get_viewing_activity()
n_data = n_parser.parseData(viewing_data)
print n_data.text_tables()
print n_data.unusual_days()
with open('data.pickle', 'w') as f:
pickle.dump(n_data, f)
def main_cached():
with open('data.pickle', 'r') as f:
n_data = pickle.load(f)
print n_data.text_tables()
print n_data.unusual_days()
if __name__ == '__main__':
main()