iOS 推特 API;如何检索一个国家/地区内最新的推文?
我是 Twitter API 和 iOS 的新手,但阅读文档后我学会了如何使用 xCode 中的“Twitter.framework”和具体的“TWRequest”类。
最明显的方法是发出请求:
GET statuses/public_timeline
但是该请求不允许参数指定纬度和经度来获取一个国家/地区内最新的公共推文。我确实发现:
GET geo/search
它允许我设置各种很酷的参数,例如纬度、经度和粒度,但不幸的是它不会在结果中返回推文。
那么有可能吗?还是成本损失?
编辑:
所以我想我应该使用:
GET search
但唯一的缺点是我应该给出aq(查询),一个搜索词,但我不是在搜索特定的词。我只是想检索特定国家/地区的最新公开推文。那么是否存在通配符,我应该使用通配符吗?
I am new to the Twitter API and iOS, but reading the documentation I learned to use the "Twitter.framework" in xCode and the "TWRequest" class in specific.
The most obvious way to go would be to make a request to:
GET statuses/public_timeline
However that request does not allow a parameter to specify a latitude and a longitude to get the most recent public tweets within a country. I did find:
GET geo/search
Which allows me to set all kind of cool parameters such as lat, long and granularity, but unfortunately it does not return tweets in the results.
So is it possible? Or a lost cost?
Edit:
So I guess I should be using:
GET search
But the only downfall is that I should give a q (query), a search term, but I am not searching for a specific term. I just like to retrieve the most recent public tweets in a given country. So is there, and should I use, a wildcard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先发出请求:
获取地点 ID。对于
荷兰
,ID 为879d7cfc66c9c290
。然后发出搜索请求:
使用查询:
示例:“q=place:879d7cfc66c9c290”
如果您想获取最新的,您还可以设置一个名为
result_type
的参数并将其设置为最近
即可。希望它能帮助人们。First make a request to:
To get the place ID. For
The Netherlands
the ID is879d7cfc66c9c290
.Then make a search request to:
With the query:
Example: "q=place:879d7cfc66c9c290"
If you like to get the most recent you can also set a parameter called
result_type
and set it torecent
and that's it. Hope it helps people.