title: Simplest PHP example for retrieving user_timeline with Twitter API version 1.1
body: <p>Because of the Twitter API 1.0 retirement as of <a href="https://dev.twitter.com/blog/api-v1-retirement-date-extended-to-june-11" rel="noreferrer">June 11th 2013</a>, the script below does not work anymore.</p>
  
  <pre><code>// Create curl resource 
  $ch = curl_init(); 
  // Set url 
  curl_setopt($ch, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/myscreenname.json?count=10"); 
  // Return the transfer as a string 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  // $output contains the output string 
  $output = curl_exec($ch); 
  // Close curl resource to free up system resources 
  curl_close($ch);
  
  if ($output) 
  {
      $tweets = json_decode($output,true);
  
      foreach ($tweets as $tweet)
      {
          print_r($tweet);
      }
  }
  </code></pre>
  
  <p>How can I get the user_timeline (recent statuses) with the least code possible?</p>
  
  <p>I found this: <a href="https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline" rel="noreferrer">https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline</a>
  but I get the following error:</p>
  
  <pre><code>"{"errors":[{"message":"Could not authenticate you","code":32}]}"
  </code></pre>
  
  <p>There are a lot of classes out there but after trying several none of them seem to work because of these updates at Twitter, plus some of them are pretty advanced classes with a lot of functionality that I don't really need. </p>
  
  <p>What is the simplest/shortest way to get the recent user statuses with PHP?</p>