-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathconst.py
132 lines (126 loc) · 2.34 KB
/
const.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
"""Constants and allowed parameter values specified in the News API."""
TOP_HEADLINES_URL = "https://newsapi.org/v2/top-headlines"
EVERYTHING_URL = "https://newsapi.org/v2/everything"
SOURCES_URL = "https://newsapi.org/v2/sources"
#: The 2-letter ISO 3166-1 code of the country you want to get headlines for. If not specified,
#: the results span all countries.
COUNTRIES = {
"ae",
"ar",
"at",
"au",
"be",
"bg",
"br",
"ca",
"ch",
"cn",
"co",
"cu",
"cz",
"de",
"eg",
"fr",
"gb",
"gr",
"hk",
"hu",
"id",
"ie",
"il",
"in",
"it",
"jp",
"kr",
"lt",
"lv",
"ma",
"mx",
"my",
"ng",
"nl",
"no",
"nz",
"ph",
"pl",
"pt",
"ro",
"rs",
"ru",
"sa",
"se",
"sg",
"si",
"sk",
"th",
"tr",
"tw",
"ua",
"us",
"ve",
"za",
}
DEFAULT_LANGUAGES = {
"ae": "ar",
"ar": "es",
"at": "de",
"au": "en",
"be": "nl",
"bg": "bg",
"br": "pt",
"ca": "en",
"ch": "de",
"cn": "zh",
"co": "es",
"cu": "es",
"cz": "cs",
"de": "de",
"eg": "ar",
"fr": "fr",
"gb": "en",
"gr": "el",
"hk": "zh",
"hu": "hu",
"id": "id",
"ie": "en",
"il": "he",
"in": "hi",
"it": "it",
"jp": "ja",
"kr": "ko",
"lt": "lt",
"lv": "lv",
"ma": "ar",
"mx": "es",
"my": "ms",
"ng": "en",
"nl": "nl",
"no": "no",
"nz": "en",
"ph": "en",
"pl": "pl",
"pt": "pt",
"ro": "ro",
"rs": "sr",
"ru": "ru",
"sa": "ar",
"se": "sv",
"sg": "en",
"si": "sl",
"sk": "sk",
"th": "th",
"tr": "tr",
"tw": "zh",
"ua": "uk",
"us": "en",
"ve": "es",
"za": "zu",
}
#: The 2-letter ISO-639-1 code of the language you want to get articles for. If not specified,
#: the results span all languages.
LANGUAGES = {"ar", "de", "en", "es", "fr", "he", "it", "nl", "no", "pt", "ru", "sv", "ud", "zh"}
#: The category you want to get articles for. If not specified,
#: the results span all categories.
CATEGORIES = {"business", "entertainment", "general", "health", "science", "sports", "technology"}
#: The order to sort article results in. If not specified, the default is ``"publishedAt"``.
SORT_METHOD = {"relevancy", "popularity", "publishedAt"}