We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Twitter Timeline Error

Development and Programming

DigiFiend's avatar
DigiFiend
41 posts
17 years ago
DigiFiend's avatar DigiFiend

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
       
LissaKay's avatar
LissaKay
46 posts
17 years ago
LissaKay's avatar LissaKay

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

       
ShortFatGuy's avatar
ShortFatGuy
1 posts
17 years ago
ShortFatGuy's avatar ShortFatGuy

Weirder is that, from what I can see, my timeline in Expression Engine is messed up, but a timeline in EE Core shows up fine.

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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.

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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.

       
Arbinshire's avatar
Arbinshire
42 posts
17 years ago
Arbinshire's avatar Arbinshire

Same error, did the above and here’s the log.

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?

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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.

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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.

       
Arbinshire's avatar
Arbinshire
42 posts
17 years ago
Arbinshire's avatar Arbinshire

Ok, the error messages are gone, but it’s still not properly authorizing w/ twitter and the same error message shows in the cache file.

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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.

       
Arbinshire's avatar
Arbinshire
42 posts
17 years ago
Arbinshire's avatar Arbinshire

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>

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

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).

       
Arbinshire's avatar
Arbinshire
42 posts
17 years ago
Arbinshire's avatar Arbinshire

Yah .. so about that not working thing.

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.

Thanks Derek.

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

:-D Glad to help, and thanks for identifying the problem, leading to the fix.

       
bigblue's avatar
bigblue
11 posts
17 years ago
bigblue's avatar bigblue

I get the same problem every time there’s a technical fault at Twitter. When I check LissaKay’s site her feed is also not working.

Seeing as Twitter was down for 6 days (in total) over the past year, it might be a good idea to make the plugin a bit more robust?

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.