-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
37 lines (27 loc) · 879 Bytes
/
__init__.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
try:
from . import facebook as fb
from . import cubadebate as cu
from . import telegram as tg
from . import twitter as tw
except (ModuleNotFoundError, ImportError):
import facebook as fb
import cubadebate as cu
import telegram as tg
import twitter as tw
def get_all_text(path=''):
return fb.get_text(path) + tg.get_text(path) + tw.get_text(path) + cu.get_text(path)
def get_all_text_with_details(path=''):
return fb.get_details_text(path) + tg.get_details_text(path) + tw.get_details_text(path) + cu.get_details_text(path)
def count_text(texts):
text_list = {
'CubaDebate': 0,
'Facebook': 0,
'Twitter': 0,
'Telegram': 0
}
for t, d, n in texts:
text_list[n] += 1
return text_list
if __name__ == '__main__':
text = get_all_text_with_details()
print(count_text(text))