Acornrevolution
Acornrevolution

Reputation: 163

Twitter User Timeline no longer working

As of June 11, the twitter timeline that worked with this code is no longer working:

<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script> <script src="https://api.twitter.com/1/statuses/user_timeline/anthonyteacher.json?callback=twitterCallback2&count=10" type="text/javascript"></script>

I used this code to custom display a simple list of tweets on my website. I check the documentation regarding the new API code but could not figure out how to get my simple tweet list back. Any help?

Here is my full original code:

<body>
<div id="twitter">
<h1>Twitter Feed</h1>
<div id="twitter_m">
 <div id="twitter_container">
 <ul id="twitter_update_list"></ul>
 </div>
</div>
</div>
<script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script>
<script src="https://api.twitter.com/1/statuses/user_timeline/anthonyteacher.json?callback=twitterCallback2&count=10" type="text/javascript"></script>

</body>

I have also tried using OAuth to get it to work with no luck:

<?php
session_start();
require_once("http://www.anthonyteacher.com/wp-content/plugins/twitteroauth/twitteroauth/twitteroauth.php"); //Path to twitteroauth library

$twitteruser = "anthonyteacher";
$notweets = 30;
$consumerkey = "key";
$consumersecret = "key";
$accesstoken = "key";
$accesstokensecret = "key";

function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
  $connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
  return $connection;
}

$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);

$tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=".$notweets);

echo json_encode($tweets);
?>

It returns nothing.

Upvotes: 1

Views: 935

Answers (1)

DannyTheDev
DannyTheDev

Reputation: 4173

You need to set up OAuth with twitter https://dev.twitter.com/docs/auth/oauth

or you can use this free service to get your tweets through javascript: http://getmytweets.co.uk/

Upvotes: 3

Related Questions