xml - Twitter:搜索我的推文并检索用户 ID,与我的关注者交叉引用?

标签 xml twitter

首先,我正在举办一场比赛,用户必须在 Twitter 上发布一条消息“刚刚输入#cool-contest,更多信息请访问 http://unique/url/239843” ' 我基本上是使用 api 进行搜索:

http://search.twitter.com/search.atom?q=%40twitterapi+OR+%40twitter

示例条目元素:

  <entry>
    <id>tag:search.twitter.com,2005:5266369259</id>
    <published>2009-10-29T19:03:56Z</published>
    <link type="text/html" href="http://twitter.com/mytweetsnl/statuses/5266369259" rel="alternate"/>
    <title>THE_REAL_SHAQ: Shaq-A-Claus is coming to town! Check out my &#8220;Join Shaq Give Back&#8221; challenge, coming.. http://bit.ly/1OVKHR</title>
    <content type="html">THE_REAL_SHAQ: &lt;b&gt;Shaq-A-Claus&lt;/b&gt; is coming to town! Check out my &#8220;Join Shaq Give Back&#8221; challenge, coming.. &lt;a href=&quot;http://bit.ly/1OVKHR&quot;&gt;http://bit.ly/1OVKHR&lt;/a&gt;</content>
    <updated>2009-10-29T19:03:56Z</updated>
    <link type="image/png" href="http://a3.twimg.com/profile_images/298078521/twitter_normal.gif" rel="image"/>
    <twitter:geo>
    </twitter:geo>
    <twitter:source>&lt;a href=&quot;http://twitterfeed.com&quot; rel=&quot;nofollow&quot;&gt;twitterfeed&lt;/a&gt;</twitter:source>
    <twitter:lang>en</twitter:lang>
    <author>
      <name>mytweetsnl (MyTweets.nl)</name>
      <uri>http://twitter.com/mytweetsnl</uri>
    </author>
  </entry>

我基本上是在尝试搜索初始用户(我)的所有转发并跟踪字符串“#cool-contest”和“http://unique/url/239843” ' 从内容元素中,然后将条目插入本地数据库,但在实际插入条目之前,我还需要确定所述用户是否是关注者,这就是为什么我需要用户 ID 与关注者交叉引用:

http://twitter.com/followers/ids.xml?screen_name=101010

我是否缺少一个额外的参数,以便我可以实际看到用户 ID?如果不是,唯一的方法就是解析 twitter URI,那么从 author 元素中获取“twitter.com/user”后面的用户名并将其作为名称参数提供?

http://twitter.com/followers/ids.xml?screen_name=mytweetsnl

我只是有点犹豫,因为我不确定该屏幕名称是否可靠,因为它将来可能会更新。

我关于这个项目的最初问题(如果您想了解更多信息):Tweet Contest logic ( Twitter )

最佳答案

使用Twitter search API的json格式.

目前,搜索 API 中的 user_ids 与其他地方使用的 Twitter 用户 ID 不同。这是一个常见问题。

The user ids in the Search API are different from those in the REST API (about the two APIs). This defect is being tracked by Issue 214. This means that the to_user_id and from_user_id field vary from the actualy user id on Twitter.com. Applications will have to perform a screen name-based lookup with the users/show method to get the correct user id if necessary.

关于xml - Twitter:搜索我的推文并检索用户 ID,与我的关注者交叉引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1653408/

相关文章:

android - 从 Twitter (Android) 获取用户的电子邮件地址

c# - 通过 LINQ 创建 XML 文档,添加 xmlns,xmlns :xsi to it

javascript - 使用 javascript 检查输入字段文本框中的多个单词

python - 在读取此 xml 之前,如何检查特定元素值 - django python

java - 在JSP中的字符串中添加新行

ios - Twitter iOS GET statuses/home_timeline 使用 Parse

php - Xpath查询结果始终为空

jquery - Twitter json 不工作

java - 超出速率限制 - 自定义 Twitter 应用程序

c# - 阅读推特提要