dongquan6030 2012-04-02 07:40
浏览 36
已采纳

如何使用PHP检索20个或更多推特状态?

This is my first time doing mobile development with twitter. I'm using Adobe Flash AS3 and PHP script to retrieve my own twitter status into my self made iphone application. However, Im unable to retrieve more than 20 statuses.

PHP:

<?php
header('Content-Type: text/html; charset=utf-8');
$name = $_GET['url'];
$url = 'http://twitter.com/statuses/user_timeline.xml?screen_name=';
$url .= $name;
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 0);
ob_start();
curl_exec ($ch);
curl_close ($ch);
$string = ob_get_contents();
$content = ob_end_clean();
echo $string;
?>

In Flash CS5.5:

private static const USERNAME:String = "twitterusername";        
private static const URL:String = "http://myserverhost.com/proxy.php?url=";        
private static const REQUEST:String = URL + USERNAME;

urlLoader = new URLLoader();
urlLoader.load(new URLRequest(REQUEST));
urlLoader.addEventListener(Event.COMPLETE, displayInfo);

I have given a read on twitter documentation(http://dev.twitter.com/docs/working-with-timelines) you gave me however Im still quite confused about "How to ask more than 20 statuses at a time". Is there any tutorial/sample code online for reference?

  • 写回答

2条回答 默认 最新

  • douwen1213 2012-04-02 07:50
    关注

    Do you mean:

    
    //use count parameter
    $count = 30;
    $url = "https://twitter.com/statuses/user_timeline/screen_name.xml?count=".$count;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?