Spaces:
Runtime error
Runtime error
Mosa
commited on
Commit
•
ba518ab
1
Parent(s):
c5c6036
added venv_twint
Browse files
twitter-scraper/scrape.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import twint
|
2 |
from datetime import date
|
3 |
|
|
|
4 |
class TwitterScraper(object):
|
5 |
"""
|
6 |
This class is a twitter TwitterScraper called TwitterScraper. It takes the user as input and collects the user's tweets
|
@@ -81,10 +82,10 @@ class TwitterScraper(object):
|
|
81 |
# \"yyyy-mm-dd\" ") raise EXCEPTION("Incorrect date type Exception!") elif (len(d1.split("-")) or len(d2.split(
|
82 |
# "-")))<2: print("[!] Please make sure the date is a string in this format \"yyyy-mm-dd\" ") raise EXCEPTION(
|
83 |
# "Incorrect date type Exception!")
|
84 |
-
|
85 |
-
|
86 |
if __name__ == "__main__":
|
87 |
-
sc = TwitterScraper(num_tweets=
|
88 |
dc = sc.scrape_by_string("jimmieakesson")
|
89 |
print(dc.head())
|
90 |
-
print(
|
|
|
|
|
|
1 |
import twint
|
2 |
from datetime import date
|
3 |
|
4 |
+
|
5 |
class TwitterScraper(object):
|
6 |
"""
|
7 |
This class is a twitter TwitterScraper called TwitterScraper. It takes the user as input and collects the user's tweets
|
|
|
82 |
# \"yyyy-mm-dd\" ") raise EXCEPTION("Incorrect date type Exception!") elif (len(d1.split("-")) or len(d2.split(
|
83 |
# "-")))<2: print("[!] Please make sure the date is a string in this format \"yyyy-mm-dd\" ") raise EXCEPTION(
|
84 |
# "Incorrect date type Exception!")
|
|
|
|
|
85 |
if __name__ == "__main__":
|
86 |
+
sc = TwitterScraper(num_tweets=1002)
|
87 |
dc = sc.scrape_by_string("jimmieakesson")
|
88 |
print(dc.head())
|
89 |
+
print(dc.shape)
|
90 |
+
|
91 |
+
|