-3

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?

Zainu
  • 794
  • 1
  • 12
  • 23

2 Answers2

2

If you are looking in the manual for the method you are using, there will be a count value that you can specify, max is 200.

So something like this

http://twitter.com/statuses/user_timeline.xml?count=[count]&screen_name=[user]
Mattias
  • 9,211
  • 3
  • 42
  • 42
  • Hi, the documentation says it will include retweets, but it does not include them. How do I use include_rts in the code? – Zainu Apr 02 '12 at 14:04
  • 1
    No you need to set `include_rts=1` also. So everything will be something like this http://twitter.com/statuses/user_timeline.xml?include_rts=1&count=[count]&screen_name=[user] – Mattias Apr 14 '12 at 16:03
  • 1
    @Zainu The only thing you need to do with all the arguments in the [manual](https://dev.twitter.com/docs/api/1/get/statuses/user_timeline) is to add them to the url separated by a `&` – Mattias Apr 14 '12 at 17:40
1

Do you mean:


//use count parameter
$count = 30;
$url = "https://twitter.com/statuses/user_timeline/screen_name.xml?count=".$count;
Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
  • Hello, thank you! This works, but it does not contain any retweets? May I know how to use max_id and since_id in the code too? – Zainu Apr 02 '12 at 14:05