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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?