Jump to content

- - - - -

The UberGames Twitter Widget



No replies to this topic

#1 TiM

TiM

    Administrator

  • UberGames Admin
  • 3,425 posts

Posted 06 November 2012 - 03:50 PM

Although it might not be very visible from the outset, I've been pretty busy setting up new components of the UberGames website. :)

Just to make it a bit more obvious on what's going on, as well as adding a bit more content to the forums, I thought I might start documenting all the stuff I'm doing. :)

Alrighty. So in the new UberGames forum theme, there's a little widget I wanted to put in the footer: A Twitter widget.
I'm not sold on the fact of UberGames needing an official Twitter account (...yet), mainly because I'm not sure if there's much awesome stuff we can tweet out of it (...yet XD).
So in the meantime, the widget is set up broadcast the latest tweet made by any UberGames developer with a Twitter account, or anyone who mentions the word 'UberGames'. :)

Since I didn't want to spend much time on it, as well as entangle it with the forum PHP code if possible (as that gets updated quite often), the widget is being powered by an open-source jQuery plugin called 'Tweet!' that uses AJAX to poll the Twitter API directly... at least, it was.

Sadly, I discovered that embedding an AJAX Twitter widget on a FORUM was a rather bad idea. Twitter only allows 150 feed requests per hour, and when the widget is getting reloaded EVERY time you load a new page (and trust me. That happens a lot on a forum), that actually adds up surprisingly fast.

So, to fix this, tonight I added a very quick PHP module that caches the JSON for the latest tweet on the UberGames server and then proxied the local Twitter widget through that.
So with that, the widget is working perfectly, and I can spam the forums extremely quickly without fear of pissing off Twitter. XD

Now that there is actually a caching solution in place though, I'm actually wondering if it is just worth killing the AJAX component and directly integrating it with the theme... XD

Ah well. Enough time spent on that. There are other sections of the site to work on!

-TiM

Attached Thumbnails

  • ss (2012-11-06 at 10.30.47).jpg





Reply to this topic



  

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users