Last active
April 21, 2020 21:10
-
-
Save Yomguithereal/296b150c332d30cd922cd676b1520801 to your computer and use it in GitHub Desktop.
API CT Minet python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from minet.crowdtangle import crowdtangle_summary | |
for result in crowdtangle_summary(urls, token='TOKEN', start_date='2017-08-01'): | |
print(result.stats) | |
print(result.posts) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from minet import RateLimitedIterator | |
from minet.crowdtangle import crowdtangle_summary | |
iterator = RateLimitedIterator(urls) | |
for url in iterator: | |
try: | |
result = crowdtangle_summary(url, token='TOKEN', start_date='2017-08-01') | |
print(result.stats) | |
except Exception as e: | |
iterator.retry() | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from minet.crowdtangle import CrowdtangleClient | |
ct = CrowdtangleClient(rate_limit=50, token='TOKEN') | |
for url in iterator: | |
stats, posts = ct.summary(url, start_date='2017-08-01') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment