Loading...

twitter-development-talk@googlegroups.com

[Prev] Thread [Next]  |  [Prev] Date [Next]

[twitter-dev] Re: XML feed not loading as before - PHP [EMAIL PROTECTED] Tue Jan 31 16:01:27 2012

Thanks Taylor,

I've corrected this and it doesnt make any difference.

$twitter_url = "http://api.twitter.com/1/statuses/user_timeline/
britishabroad.xml";

$buffer = file_get_contents($twitter_url);
$xml = new SimpleXMLElement($buffer);

$status_item = $xml -> status;
$status =  $status_item -> text;

echo $status;


Here is the link:
http://demophon.fco.gov.uk/dashboard/test.php

As I said, it was working before but not anymore.

Would appreciate any help?

Thx

Colin

On Jul 6, 5:09 pm, Taylor Singletary <[EMAIL PROTECTED]>
wrote:
> Hi Colin,
>
> You're missing the api subdomain and version "1".. this should work for you
> instead:
>
> http://api.twitter.com/1/statuses/user_timeline/britishabroad.xml?cou...
>
> Taylor
>
> On Tue, Jul 6, 2010 at 8:18 AM, [EMAIL PROTECTED] <
>
> [EMAIL PROTECTED]> wrote:
> > With the following feed/script:
>
> > $twitter_url = "http://twitter.com/statuses/user_timeline/
> > britishabroad.xml?count=1";
>
> > $buffer = file_get_contents($twitter_url);
> > $xml = new SimpleXMLElement($buffer);
>
> > $status_item = $xml -> status;
> > $status =  $status_item -> text;
>
> > echo $status;
>
> > Nothing is being returned.
>
> > Initally it had been working with "simplexml_load_file" but now
> > everything has stopped.  It is working on my local environment, but as
> > soon as the file is tested on the server, nothing is working.
>
> > I have tested this with different XMLs and they're fine.
>
> > The error showing is:
>
> > Fatal error: Uncaught exception 'Exception' with message 'String could
> > not be parsed as XML' in /home/bhammers/demophon/dashboard/test.php:5
> > Stack trace: #0 /home/bhammers/demophon/dashboard/test.php(5):
> > SimpleXMLElement->__construct('') #1 {main} thrown in /home/bhammers/
> > demophon/dashboard/test.php on line 5
>
> > I have google this and it seems suggest this is a twitter error?
>
> > Thanks in advance