-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgg_api.py
70 lines (61 loc) · 5.52 KB
/
gg_api.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'''Version 0.35'''
import tweet_reader
from globals import awardsDict
OFFICIAL_AWARDS_1315 = ['cecil b. demille award', 'best motion picture - drama', 'best performance by an actress in a motion picture - drama', 'best performance by an actor in a motion picture - drama', 'best motion picture - comedy or musical', 'best performance by an actress in a motion picture - comedy or musical', 'best performance by an actor in a motion picture - comedy or musical', 'best animated feature film', 'best foreign language film', 'best performance by an actress in a supporting role in a motion picture', 'best performance by an actor in a supporting role in a motion picture', 'best director - motion picture', 'best screenplay - motion picture', 'best original score - motion picture', 'best original song - motion picture', 'best television series - drama', 'best performance by an actress in a television series - drama', 'best performance by an actor in a television series - drama', 'best television series - comedy or musical', 'best performance by an actress in a television series - comedy or musical', 'best performance by an actor in a television series - comedy or musical', 'best mini-series or motion picture made for television', 'best performance by an actress in a mini-series or motion picture made for television', 'best performance by an actor in a mini-series or motion picture made for television', 'best performance by an actress in a supporting role in a series, mini-series or motion picture made for television', 'best performance by an actor in a supporting role in a series, mini-series or motion picture made for television']
OFFICIAL_AWARDS_1819 = ['best motion picture - drama', 'best motion picture - musical or comedy', 'best performance by an actress in a motion picture - drama', 'best performance by an actor in a motion picture - drama', 'best performance by an actress in a motion picture - musical or comedy', 'best performance by an actor in a motion picture - musical or comedy', 'best performance by an actress in a supporting role in any motion picture', 'best performance by an actor in a supporting role in any motion picture', 'best director - motion picture', 'best screenplay - motion picture', 'best motion picture - animated', 'best motion picture - foreign language', 'best original score - motion picture', 'best original song - motion picture', 'best television series - drama', 'best television series - musical or comedy', 'best television limited series or motion picture made for television', 'best performance by an actress in a limited series or a motion picture made for television', 'best performance by an actor in a limited series or a motion picture made for television', 'best performance by an actress in a television series - drama', 'best performance by an actor in a television series - drama', 'best performance by an actress in a television series - musical or comedy', 'best performance by an actor in a television series - musical or comedy', 'best performance by an actress in a supporting role in a series, limited series or motion picture made for television', 'best performance by an actor in a supporting role in a series, limited series or motion picture made for television', 'cecil b. demille award']
def get_hosts(year):
'''Hosts is a list of one or more strings. Do NOT change the name
of this function or what it returns.'''
# Your code here
hosts = []
return hosts
def get_awards(year):
'''Awards is a list of strings. Do NOT change the name
of this function or what it returns.'''
# Your code here
tweet_reader.AnalyzeTweets()
awardsDict.dict = dict(sorted(awardsDict.dict.items(), key=lambda x: x[1]['tally'], reverse=True)[:30])
awards = list(awardsDict.dict.keys())
print(awards)
return awards
def get_nominees(year):
'''Nominees is a dictionary with the hard coded award
names as keys, and each entry a list of strings. Do NOT change
the name of this function or what it returns.'''
# Your code here
nominees = {award: [] for award in OFFICIAL_AWARDS_1315}
return nominees
def get_winner(year):
'''Winners is a dictionary with the hard coded award
names as keys, and each entry containing a single string.
Do NOT change the name of this function or what it returns.'''
# Your code here
winners = {award: "" for award in OFFICIAL_AWARDS_1315}
return winners
def get_presenters(year):
'''Presenters is a dictionary with the hard coded award
names as keys, and each entry a list of strings. Do NOT change the
name of this function or what it returns.'''
# Your code here
presenters = {award: [] for award in OFFICIAL_AWARDS_1315}
return presenters
def pre_ceremony():
'''This function loads/fetches/processes any data your program
will use, and stores that data in your DB or in a json, csv, or
plain text file. It is the first thing the TA will run when grading.
Do NOT change the name of this function or what it returns.'''
# Your code here
print("Pre-ceremony processing complete.")
return
def main():
'''This function calls your program. Typing "python gg_api.py"
will run this function. Or, in the interpreter, import gg_api
and then run gg_api.main(). This is the second thing the TA will
run when grading. Do NOT change the name of this function or
what it returns.'''
# Your code here
tweet_reader.AnalyzeTweets()
awardsDict.dict = dict(sorted(awardsDict.dict.items(), key=lambda x: x[1]['tally'], reverse=True)[:20])
return
if __name__ == '__main__':
main()