0

I used the following code to try to grab tweets from my home_timeline

    $tmhOAuth = new tmhOAuth(array('consumer_key'    => TW_KEY,
                   'consumer_secret' => TW_SECRET,
                      'user_token'      => TW_UTOKEN,
                      'user_secret'     => TW_USECRET,
                       ));
    $code = $tmhOAuth->request('GET', $tmhOAuth->url('1.1/statuses/home_timeline', 'json'));

The $tmhOAuth came from this library here: https://github.com/themattharris/tmhOAuth

For some reason, only one tweet is showing, and it's my most recent one. All my old tweets are not visible. When I change the secrets and keys to that of another user-app, i have similar problme, some tweets are visible while others are not. Does anyone know why it doesnt' just grab all X number of the most recent tweets? Why are some tweets missing?

John
  • 32,403
  • 80
  • 251
  • 422
  • 1
    Further to your [previous question](http://stackoverflow.com/questions/17097357/twitter-search-by-hashtag-example-api-v-1-1), did you even try the library I suggested? Try alternative libraries and then, if you still get the same results back from the API, you know it's an issue on Twitter's side. – Jimbo Jun 25 '13 at 12:07

1 Answers1

0

I download Jimbo's API from github and then did hte following code

<?php
ini_set('display_errors', 1);
require_once('twjimbo/TwitterAPIExchange.php');

/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
    'oauth_access_token' => "",
    'oauth_access_token_secret' => "",
    'consumer_key' => '',
    'consumer_secret' => ""
);

]
$url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';
$getfield = '?screen_name=anythingworkshere';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
$json = $twitter->setGetfield($getfield)
             ->buildOauth($url, $requestMethod)
             ->performRequest();

echo '<pre>'; print_r(json_decode($json)); echo '</pre>';
John
  • 32,403
  • 80
  • 251
  • 422