我如何按国家/地区获得顶级 tweeps? [英] How do I get top tweeps by country?

查看:17
本文介绍了我如何按国家/地区获得顶级 tweeps?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何按国家/地区获得顶级 tweeps.

I want to know how to get top tweeps by country.

例如:http://india.twirus.com/?category=india&freqtype=今天

Tweeps = twitter 人 ;)

Tweeps = twitter People ;)

排名逻辑:过去 24 小时的最高提及个人资料. *(如果您有任何获得热门 tweeps 的连击逻辑,您也可以向我推荐)

Ranking Logic : Top Mention profile for last 24hrs. *(You can also suggest me if you have any batter logic to get popular tweeps)

我尝试了 twitter API,但找不到这个.

I tried twitter API but not able to find this one.

如果没有可用的api,您也可以建议可能的逻辑.

推荐答案

您必须搜索对于包含所有感兴趣的推文,然后遍历结果为每个用户创建一个计数.然后,您的问题就变成了对结果进行排序的简单案例.

You must search for tweets that include all those of interest, then loop over the results creating a count for each user. Your problem then becomes a simple case of ordering the results.

由于每个请求最多有 100 个结果(每个分页结果大约 1500 个),您几乎肯定必须通过指定 since_id 和/或 max_id参数.

Since there is a maximum of 100 results per request (and circa 1500 per paginated results), you will almost certainly have to chunk the results by specifying since_id and/or max_id parameters.

  • 如果您希望获得关于您感兴趣的国家的推文,您可以通过地点(您首先必须使用地理搜索API 识别您感兴趣的国家/地区的地点 ID;在印度的情况下,地点 ID 为 b850c1bfd38f30e0).

  • If you wish to obtain tweets about your country of interest, you can search by place (you will first have to use the geo search API to identify the place ID of your country of interest; in the case of India, the place ID is b850c1bfd38f30e0).

如果您希望从您感兴趣的国家/地区获得推文,您可以指定一个geocode参数,该参数由该国家/地区内的一个点和一个足够的半径组成大到包括该国的其余部分.这两个元素都可以通过以下方式一次性获得:

If you wish to obtain tweets from within your country of interest, you can specify a geocode parameter consisting of a point within the country and a radius sufficiently large to encompass the remainder of the country. Both elements can be obtained as a one-off exercise in the following manner:

  1. 确定感兴趣国家的边界​​多边形;这些可以从现有来源获得,例如从 CloudMade 下载站点.对于印度,坐标可在此处获得.

  1. Identify a bounding polygon for the country of interest; these can be obtained from existing sources, for example from the CloudMade downloads site. In the case of India, the coordinates are available here.

找到多边形顶点的最小边界圆,记住使用地理距离 在计算中.

Find the minimum bounding circle for the polygon's vertices, remembering to use geographical distance in the calculations.

如果您希望排除在圆圈内但在国家边界多边形之外进行地理标记的推文,则对于每个生成的推文,您必须确定坐标是否位于多边形内.

If you wish to exclude tweets which are geotagged within the circle but outside the country's bounding polygon, for each resulting Tweet you must determine whether its coordinates lay within the polygon or not.

这篇关于我如何按国家/地区获得顶级 tweeps?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆