I came into work and checked my site today to notice the following error on my home page (twice), any ideas on what may be causing it?
I’ve done absolutely nothing to the template code today, the only thing I have done having anthing to do with twitter was the installation of a twitter Vista widget.
Warning: Invalid argument supplied for foreach() in /system/plugins/pi.twitter_timeline.php on line 292
Same thing is happening at my place ... I turned on Template Debugging, but there doesn’t seem to be much there that is useful. All appears normal. The PHP errors I have are:
Notice: Undefined index: user in /system/plugins/pi.twitter_timeline.php on line 187
Notice: Undefined index: created_at in /system/plugins/pi.twitter_timeline.php on line 249
Notice: Undefined offset: 1 in /system/plugins/pi.twitter_timeline.php on line 509
Notice: Undefined offset: 0 in /system/plugins/pi.twitter_timeline.php on line 510
Notice: Undefined offset: 5 in /system/plugins/pi.twitter_timeline.php on line 512
Notice: Undefined offset: 2 in /plugins/pi.twitter_timeline.php on line 512
Notice: Undefined offset: 3 in /system/plugins/pi.twitter_timeline.php on line 512
Notice: Undefined index: user in /system/plugins/pi.twitter_timeline.php on line 187
Notice: Undefined index: created_at in /system/plugins/pi.twitter_timeline.php on line 249
Notice: Undefined offset: 1 in /system/plugins/pi.twitter_timeline.php on line 509
Notice: Undefined offset: 0 in /system/plugins/pi.twitter_timeline.php on line 510
Notice: Undefined offset: 5 in /system/plugins/pi.twitter_timeline.php on line 512
Notice: Undefined offset: 2 in /system/plugins/pi.twitter_timeline.php on line 512
Notice: Undefined offset: 3 in /system/plugins/pi.twitter_timeline.php on line 512
It appears to be a change at Twitter, since neither of us changed anything on our end. I’d really like to be able to keep using this plug-in, it’s got a coolness and W0W factor that makes my Twitter buddies all jealous and stuff (Dontcha wish your blog was cool like mine!) :D
Can you go into your /system/cache/twitter_timeline/ folder, open one of the XML files and send me the contents please? I don’t even have a Twitter account anymore, so I have not kept up with any possible changes made to their API.
Thanks Lissa, but I’d need to copy of what’s being retrieved on a page load where you get the errors. Since the cache would be overwritten on subsequent requests, use this plugin file, which will write a new cache file containing some debugging information if those variables aren’t set. It will be in your /system/cache/twitter_timeline/ folder under the name ‘95c073b2b2b12543eb20548527cbd89b’.
If the errors happen again, go look for that file, and then send that to me, please.
1210864099
<?xml version=“1.0” encoding=“UTF-8”?>
<hash>
<request>/statuses/user_timeline.xml</request>
<error>Authentication required to request your own timeline.</error>
</hash>
The curl and fsock methods are failing, despite passing correct basic authentication parameters. Perhaps once this is eventually fixed, you can also add @‘s to the function calls so that it fails gracefully?
I see, that’s a change on their end, then, as they used to not send valid XML back for errors, they sent HTML pages. Using @ would not be advised, as that would not only prevent one from getting the errors that would help discover the problem, but it spawns a number of processes to suppress a PHP error, and should be used sparingly, on functions that can frequently fail in certain environments, not to hide errors caused by faulty program logic.
The plugin has been updated to version 1.1 and will now parse Twitter’s XML error reponses, and display them in the template parsing log. You can download an updated version here.
The default cache holding time is 15 minutes, so you will need to either manually clear your caches, or temporarily set the twitter_refresh= parameter to a low or zero value to force a fresh request.
Yup. I’ve been deleting the cache, and it’s still showing the same error message in the cache, and occasionally an error message displayed while loading the page.
1210876257
<?xml version=“1.0” encoding=“UTF-8”?>
<hash>
<request>/statuses/user_timeline.xml</request>
<error>Authentication required to request your own timeline.</error>
</hash>
Are you supplying a valid username in the user= parameter, and a password with the password= parameter? If you are getting other errors, please cut and paste them. As you can see, it’s working fine here (see sidebar).
Short Answer: Me = Moron. Gmail email addresses end with .com, and not .cmo as I had entered. Usually I pride myself on catching silly errors. Not this time. D’oh.
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.
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
What are the contents of your Twitter Timeline cache file at that point, bigblue? It shouldn’t be making it to variable parsing unless a valid, tweet-filled XML response is received.