-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtweet.py
More file actions
28 lines (27 loc) · 1.1 KB
/
tweet.py
File metadata and controls
28 lines (27 loc) · 1.1 KB
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
class Tweet:
def __init__(self, text, id, state, created_at, author_id, author_name, media_url= None, text_classification = None, contains_malicious_phrases = None, ocr_info = None, brands = None):
self.text = text
self.id = id
self.state = state
self.created_at = created_at
self.author_id = author_id
self.media_url = media_url
self.author_name = author_name
self.text_classification = text_classification
self.contains_malicious_phrases = contains_malicious_phrases
self.ocr_info = ocr_info
self.brands = brands
def to_dict(self):
return {
"text": self.text,
"id":self.id,
"state": self.state,
"created_at": self.created_at,
"author_id": self.author_id,
"author_name": self.author_name,
"text_classification": self.text_classification,
"contains_malicious_phrases": self.contains_malicious_phrases,
"ocr_info": self.ocr_info,
"media_url": self.media_url,
"brands": self.brands
}