forked from ryanjgallagher/focalevents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
executable file
·219 lines (218 loc) · 6.53 KB
/
config.yaml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---
# Database info
psql:
host: null
port: null
user: ""
database: ""
password: null
# Keys for accessing the Twitter API v2
keys:
twitter:
api_key: ""
api_secret_key: ""
bearer_token: ""
# Directories of input for running API queries, i.e. event config files
input:
twitter:
stream: "input/twitter/stream"
search: "input/twitter/search"
# Directories of output, mainly JSON files
output:
json:
twitter:
stream: "output/twitter/stream"
search: "output/twitter/search"
quote_search: "output/twitter/search/quotes"
convo_search: "output/twitter/search/convos"
timeline_search: "output/twitter/search/timelines"
psql:
twitter:
schema: "twitter"
tables:
tweets: "tweets"
users: "users"
media: "media"
places: "places"
# Endpoints for APIs
endpoints:
twitter:
rules: "https://api.twitter.com/2/tweets/search/stream/rules"
stream: "https://api.twitter.com/2/tweets/search/stream"
search: "https://api.twitter.com/2/tweets/search/all"
user: "https://api.twitter.com/2/users"
users_lookup: "https://api.twitter.com/2/users/by"
count: "https://api.twitter.com/2/tweets/counts/all"
# Rate limits on the number of calls per 15 mins
rate_limits:
twitter:
search: 300
timelines: 1500
# Twitter expansions
expansions:
- "author_id"
- "referenced_tweets.id"
- "referenced_tweets.id.author_id"
- "entities.mentions.username"
- "geo.place_id"
- "attachments.media_keys"
# Data fields that we request for different API objects
request_fields:
twitter:
tweets:
- "author_id"
- "conversation_id"
- "created_at"
- "in_reply_to_user_id"
- "lang"
- "possibly_sensitive"
- "public_metrics"
- "referenced_tweets"
- "reply_settings"
- "source"
- "entities"
- "attachments"
- "geo"
users:
- "name"
- "username"
- "created_at"
- "description"
- "location"
- "public_metrics"
- "url"
- "verified"
- "pinned_tweet_id"
- "profile_image_url"
- "entities"
media:
- "duration_ms"
- "height"
- "width"
- "preview_image_url"
- "public_metrics"
places:
- "contained_within"
- "country"
- "country_code"
- "geo"
- "name"
- "place_type"
# Data fields that we insert/store into the database for different API objects
insert_fields:
twitter:
tweets:
id: "TEXT"
event: "TEXT"
inserted_at: "TIMESTAMPTZ"
last_updated_at: "TIMESTAMPTZ"
from_search: "BOOLEAN"
directly_from_search: "BOOLEAN"
from_stream: "BOOLEAN"
directly_from_stream: "BOOLEAN"
from_convo_search: "BOOLEAN"
directly_from_convo_search: "BOOLEAN"
from_quote_search: "BOOLEAN"
directly_from_quote_search: "BOOLEAN"
from_timeline_search: "BOOLEAN"
directly_from_timeline_search: "BOOLEAN"
text: "TEXT"
lang: "TEXT"
author_id: "TEXT"
author_handle: "TEXT"
created_at: "TIMESTAMPTZ"
conversation_id: "TEXT"
possibly_sensitive: "BOOLEAN"
reply_settings: "TEXT"
source: "TEXT"
author_follower_count: "INTEGER"
retweet_count: "INTEGER"
reply_count: "INTEGER"
like_count: "INTEGER"
quote_count: "INTEGER"
replied_to: "TEXT"
replied_to_author_id: "TEXT"
replied_to_handle: "TEXT"
replied_to_follower_count: "INTEGER"
quoted: "TEXT"
quoted_author_id: "TEXT"
quoted_handle: "TEXT"
quoted_follower_count: "INTEGER"
retweeted: "TEXT"
retweeted_author_id: "TEXT"
retweeted_handle: "TEXT"
retweeted_follower_count: "INTEGER"
mentioned_author_ids: "TEXT[]"
mentioned_handles: "TEXT[]"
hashtags: "TEXT[]"
urls: "JSONB[]"
media_keys: "TEXT[]"
place_id: "TEXT"
users:
id: "TEXT"
event: "TEXT"
inserted_at: "TIMESTAMPTZ"
last_updated_at: "TIMESTAMPTZ"
name: "TEXT"
username: "TEXT"
created_at: "TIMESTAMPTZ"
description: "TEXT"
location: "TEXT"
pinned_tweet_id: "TEXT"
followers_count: "INTEGER"
following_count: "INTEGER"
tweet_count: "INTEGER"
url: "TEXT"
profile_image_url: "TEXT"
description_urls: "JSONB[]"
description_hashtags: "TEXT[]"
description_mentions: "TEXT[]"
verified: "BOOLEAN"
media:
id: "TEXT"
event: "TEXT"
inserted_at: "TIMESTAMPTZ"
last_updated_at: "TIMESTAMPTZ"
type: "TEXT"
duration_ms: "INTEGER"
height: "INTEGER"
width: "INTEGER"
preview_image_url: "TEXT"
view_count: "INTEGER"
places:
id: "TEXT"
event: "TEXT"
inserted_at: "TIMESTAMPTZ"
last_updated_at: "TIMESTAMPTZ"
name: "TEXT"
full_name: "TEXT"
country: "TEXT"
country_code: "TEXT"
geo: "JSONB"
place_type: "TEXT"
# Fields to update when doing database insertion
update_fields:
twitter:
tweets:
- "last_updated_at"
- "author_follower_count"
- "retweet_count"
- "reply_count"
- "like_count"
- "quote_count"
- "replied_to"
- "replied_to_author_id"
- "replied_to_follower_count"
- "quoted"
- "quoted_author_id"
- "quoted_follower_count"
users:
- "last_updated_at"
- "followers_count"
- "following_count"
- "tweet_count"
media:
- "last_updated_at"
- "view_count"
places:
- "last_updated_at"