python - Python 中的 TwitterAPI - 如何仅从一个国家/地区返回推文?
问题描述
我正在使用 Python 中的 TwitterAPI 使用一些关键字访问 Twitter 上的完整推文存档。我在文档中读到,我可以使用 place_country 和国家代码指定位置,但由于某种原因,它不会只返回那个国家的结果。如何从按国家/地区过滤的完整档案中获取推文?
from TwitterAPI import TwitterAPI
r = api.request("tweets/search/fullarchive/:cs",
{"query":"Corona place_country:DE",
"maxResults": "100",
"fromDate":"201908230000",
"toDate":"202004300000"})
解决方案
I don't think it's possible this way, place_country is not a field that you can use from the standard search api (https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets).
You can probably use "geocode" with a large "radius" and "lang" parameter.
推荐阅读
- java - 如何让程序在java中检查一个字母的实例?
- flutter - 如何在颤动中限制onLocationChanged
- karate - 有没有办法查看架构验证失败的地方?
- python - 如何在 anaconda 中添加共享库?
- node.js - 无服务器 & aws lambda & puppeteer & Node.js
- visual-studio-code - vscodevim:闲置一段时间后,
在命令行中返回“正常”模式或明文 - json - Jmeter Json Extractor:JSONPath 表达式适用于评估器,但不适用于 jmeter?
- mysql - ORDER BY RAND() 和大表的问题
- javascript - 如何升级lerna分包的node模块
- python - Django 表单 - 自动填写表单的用户 url attr - RelatedObjectDoesNotExist