Note that there are some explanatory texts on larger screens.

plurals
  1. POgetFriendsTimeline Returning Nothing
    text
    copied!<p>I'm using the <a href="http://github.com/jdp/twitterlibphp/tree/master" rel="nofollow">Twitterlibphp</a> for a Twitter project and using the <a href="http://jdp.github.com/twitterlibphp/doc/twitterlibphp/TwitterBase.html#methodgetFriendsTimeline" rel="nofollow"><code>getFriendsTimeline()</code></a> method to get my Home timeline. The problem is that with this code:</p> <pre><code>&lt;?php // require the twitter library require "scripts/twitter.lib.php"; // your twitter username and password $username = "MyUser"; $password = "MyPass"; // initialize the twitter class $twitter = new Twitter($username, $password); // fetch public timeline in xml format $options = array("count" =&gt; 20); $xml = $twitter-&gt;getFriendsTimeline($options); //$xml = $twitter-&gt;getPublicTimeline(); $twitter_status = new SimpleXMLElement($xml); foreach($twitter_status-&gt;status as $status) { foreach($status-&gt;user as $user) { echo '&lt;li class="tweet"&gt;&lt;img src="' . $user-&gt;profile_image_url . '" class="twitter_image"&gt;'; echo '&lt;a href="http://www.twitter.com/' . $user-&gt;name . '"&gt;' . $user-&gt;name . '&lt;/a&gt;: '; } echo $status-&gt;text; echo '&lt;br/&gt;'; echo '&lt;div class="twitter_posted_at"&gt;Posted at: ' . $status-&gt;created_at . '&lt;/div&gt;'; echo "&lt;/li&gt;"; } ?&gt; </code></pre> <p>When I tried to <code>echo $xml</code> I got this response:</p> <blockquote> <p>Basic authentication is not supported</p> </blockquote> <p>What I'm doing wrong?</p> <p>Before I tried this code I was using the <a href="http://jdp.github.com/twitterlibphp/doc/twitterlibphp/TwitterBase.html#methodgetPublicTimeline" rel="nofollow"><code>getPublicTimeline()</code></a> correctly and without any problems.</p> <p><em>PS: On my source code the</em> <code>$username</code> <em>and</em> <code>$password</code> <em>variables are correct and using my credentials</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload