Did you update to the latest version and clear your caches, bigblue? Seeing how Lissa hasn’t replied to this thread or me privately since the original correspondence, I gather she has not followed this issue nor applied the fix. The plugin is now doing all it can to degrade gracefully when Twitter is having service problems.
Where are you getting that statistic, is it published? Perhaps that is accumulated time of their web service being down? Interesting in any case, and still remarkably bad considering that it’s spread out over many days during peak usage, but still doesn’t account for other problems such as faulty connectivity, slowness, and data syncing with their API, which can cause any service that uses it to fail at times even when their web service is up.
Hi Derek, thanks for your prompt reply.
I had applied the fix and cleared my caches. The problem occurs when twitter is down. LissaKay’s twitter timeline also wasn’t working when the site was down and is working now (as is mine, without further intervention).
Part of the problem is that it seems to “break” my template html when Twitter is down. In my case it only occurs when I’m logged on (perhaps it’s the debugging error messages?). However looking at LissaKay’s site yesterday, I most certainly wasn’t logged in and it seemed to “break” her layout too.
The statistic appeared on the Twitter forums - yes, it is the accumulated time they were down over the past 12 months (allegedly).
The output of the Twitter Timeline plugin when Twitter was down was as follows (at both my site and LissaKay’s):
profile image
~ 7 years, 5 months, 3 weeks, 3 days, 18 hours, 59 minutes ago
profile image
~ 7 years, 5 months, 3 weeks, 3 days, 18 hours, 59 minutes ago
The template debugging messages were as per LissaKay’s post above.
OK, here goes.
Here’s the error messages first:
Notice: Undefined index: user in /home/system/plugins/pi.twitter_timeline.php on line 197
Notice: Undefined index: created_at in /home/system/plugins/pi.twitter_timeline.php on line 259
Notice: Undefined offset: 1 in /home/system/plugins/pi.twitter_timeline.php on line 519
Notice: Undefined offset: 0 in /home/system/plugins/pi.twitter_timeline.php on line 520
Notice: Undefined offset: 5 in /home/system/plugins/pi.twitter_timeline.php on line 522
Notice: Undefined offset: 2 in /home/system/plugins/pi.twitter_timeline.php on line 522
Notice: Undefined offset: 3 in /home/system/plugins/pi.twitter_timeline.php on line 522
Notice: Undefined index: user in /home/system/plugins/pi.twitter_timeline.php on line 197
Notice: Undefined index: created_at in /home/system/plugins/pi.twitter_timeline.php on line 259
Notice: Undefined offset: 1 in /home/system/plugins/pi.twitter_timeline.php on line 519
Notice: Undefined offset: 0 in /home/system/plugins/pi.twitter_timeline.php on line 520
Notice: Undefined offset: 5 in /home/system/plugins/pi.twitter_timeline.php on line 522
Notice: Undefined offset: 2 in /home/system/plugins/pi.twitter_timeline.php on line 522
Notice: Undefined offset: 3 in /home/system/plugins/pi.twitter_timeline.php on line 522
And here are the contents of the cache:
And this is what gets “twittered”:
7 years, 5 months, 3 weeks, 4 days, 15 hours, 28 minutes ago
7 years, 5 months, 3 weeks, 4 days, 15 hours, 28 minutes ago
The variables seem to be all blank, so the links (that I configured) are all to:
http://twitter.com//statuses/
Odd, it shouldn’t be parsing that as XML, bigblue, it should be failing and returning an empty string, and logging the message “Twitter Timeline error: Unable to retreive statuses from Twitter.com”. Following the conditional on line 127 that reads:
if (($xml_obj = $XML->parse_xml($rawxml)) === FALSE)
{
$TMPL->log_item("Twitter Timeline error: Unable to retreive statuses from Twitter.com");
$this->return_data = '';
return;
}
Can you add:
echo '<pre>';print_r($xml_obj);echo'</pre>
<p>’;
And then cut and paste the output? If the service is connecting successfully, overwriting the contents of your cache file manually with what you have above (except the first line, the timestamp) should force a triggering of these errors you are receving.
Unusual, with that source, both systems I am testing on still return FALSE on attempting to parse it.
At any rate, this should solve the problem so long as Twitter keeps sending HTML content when the API is down. Please give it a try and let me know, at your convenience; this is a long weekend afterall. :-D
Hi Derek,
Sorry for the delay in getting back to you.
I implemented the change, but I also did another adjustment. I entered “-60” into the server offset parameter in the control panel. (I had noticed that the time of my posts in the twitter timeline was incorrect).
Now I don’t get the error, and when Twitter is down the timeline is simply blank.
cheers, BBM
Since twitter is down, yet again, I’ve been having problems with it failing and displaying ugly error messages. I looked at the twitter plugin code, and echo’d the $rawxml data and saw that the plugin wasn’t parsing it correctly.
Being the lazy coder I am, I opted to just search for the “</error>” xml closing tag, and if it finds it, just return an error and stop further processing from the plugin. Below is my code (inserted after line 96 of pi.twitter_timeline.php):
if (preg_match("/(<\\/error>)/is", $rawxml)) {
$TMPL->log_item("Twitter is down.");
$this->return_data = 'Twitter is down, again.';
return;
}
Twitter error message:
<?xml version="1.0" encoding="UTF-8"?>
<error reason="temporary maintenance" deadline="30 minutes">
Twitter is down for temporary maintenance. It will return in 30 minutes.
</error>
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.