Get Latest Tweet

Hi everyone, I got the code below from this site

$user = 'galileedetroit';
$uri = "{$user}.json?count=1";
$raw = file_get_contents($uri);
$data = json_decode($raw);
$tweet = end($data);
$html = $tweet->text;
$trimmed = trim($html);
$linked = preg_replace('/(https?:\\/\\/\\S+)/', '<a target="_blank" href="\\1">\\1</a>', $trimmed);
print $linked;

For some reason, I keep getting the following error:


Warning: file_get_contents( failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in C:\vhosts\galileedetroit\index2.php on line 50


Warning: end() expects parameter 1 to be array, null given in C:\vhosts\galileedetroit\index2.php on line 52

I am working on a local server. Don’t have access to my remote right now. Is this one of those things that just won’t work locally? Sorry to sound stupid, but I don’t really mess with PHP. I am digging on JavaScript right now, but I really want to use PHP for this because the JavaScript equivalent is causing script conflicts that I don’t feel are going to get any better any time soon (and I’m tired of effing with it :mad:).


You can find the answer to your question by visiting that URL in a browser:

{“errors”:[{“message”:“Sorry, that page does not exist”,“code”:34}]}