不需要api密钥的python twitter scraper。
tweetlib的Python项目详细描述
推特刮板
不需要api密钥的python twitter scraper。
安装
pip3 install tweetlib
如何使用
所有这些参数都可以相互结合使用。
ts = tweetlib.TweetLib(username="barackobama", max_tweets=10)
参数
- 用户名(str):任何你想擦掉的有效twitter名称
- 自(“yyyy-mm-dd”):限制搜索的下限日期。
- 直到(“yyyy-mm-dd”):限制搜索的上限日期。
- 查询搜索(str):搜索字符串
- max_tweets(int):您要删除的最大tweets数。
示例
fromtweetlibimporttweetlib# Get tweets by usernamets=tweetlib.TweetLib(username="barackobama",max_tweets=10)tweets=ts.get_tweets()# Search for tweetsts=tweetlib.TweetLib(query_search="college",since="2018-01-01")tweets=ts.get_tweets()
tweet对象
它在列表中返回的tweet对象包含以下内容:
tweet = {
id (str)
permalink (str)
username (str)
text (str)
date (date)
replies (int)
retweets (int)
favorites (int)
mentions (str)
hashtags (str)
}
信用卡和联系人
由怀亚特·弗格森创建
如果您有任何意见或问题,可以在twitter上联系我,也可以访问我的小投资组合wyattf.dev