2013-03-06 80 views
1

我试图让所有的答复鸣叫即回复到这条推文:检索Twitter的谈话

https://twitter.com/bbcworldservice/status/309345806123667456

我有这方面的工作使用类似:

https://api.twitter.com/1.1/statuses/mentions_timeline.json?count=100&since_id=309345806123667456

但是我后来发现,这会返回所有最近的推文,而不是此ID以后的所有推文。所以说这个用户被提及的次数远远超过100次,这个推文的回复不再包括在内。渲染它没用。

任何人都可以帮忙吗?提供任何替代建议?

感谢, 海伦

回答

0

我遇到了同样的问题来了几个月前在工作,因为我以前使用REST V1他们related_tweets端点。

所以我不得不创建一个解决方法,我已经在这里记录。 http://adriancrepaz.com/twitter_conversations_api

这个班级应该做你想做的。 它刮掉移动网站的HTML,并解析对话。我用了一段时间,看起来非常可靠。

要提取的对话......

请求

<?php 

require_once 'acTwitterConversation.php'; 

$twitter = new acTwitterConversation; 
$conversation = $twitter->fetchConversion(324215761998594048); 
print_r($conversation); 

?> 

响应

Array 
(
    [error] => false 
    [tweets] => Array 
     (
      [0] => Array 
       (
        [id] => 324214451756728320 
        [state] => before 
        [username] => facebook 
        [name] => Facebook 
        [content] => Facebook for iOS v6.0 ? Now with chat heads and stickers in private messages, and a more beautiful News Feed on iPad itunes.apple.com/us/app/faceboo? 
        [date] => 16 Apr 
        [images] => Array 
         (
          [thumbnail] => https://pbs.twimg.com/profile_images/3513354941/24aaffa670e634a7da9a087bfa83abe6_normal.png 
          [large] => https://pbs.twimg.com/profile_images/3513354941/24aaffa670e634a7da9a087bfa83abe6.png 
         ) 
       ) 

      [1] => Array 
       (
        [id] => 324214861728989184 
        [state] => before 
        [username] => michaelschultz 
        [name] => Michael Schultz 
        [content] => @facebook good April Fools joke Facebook?.chat hasn?t changed. No new features. 
        [date] => 16 Apr 
        [images] => Array 
         (
          [thumbnail] => https://pbs.twimg.com/profile_images/414193649073668096/dbIUerA8_normal.jpeg 
          [large] => https://pbs.twimg.com/profile_images/414193649073668096/dbIUerA8.jpeg 
         ) 
       ) 
      ....    
     ) 
) 

希望它能帮助, 阿德里安。

+0

链接已损坏,是否有备份? – 2015-11-08 09:29:15