[browse entry tags]

latest entries
>The Week in Links
08.29.08 / Joe
>Cheapo game shootout!
08.28.08 / Joe
>Screenshot ability may be coming to PS3.
08.26.08 / Joe
>The baddest kid that ever saved the day.
08.25.08 / Joe
>Things We Learned This Week
08.24.08 / Joe
>The Week in Links
08.23.08 / Joe
>Sprinting for the finish line.
08.21.08 / Joe
>What one through five mean to me.
08.19.08 / Joe
>Things We Learned This Week
08.17.08 / Joe
>An amazing logo design: the Princess Bride DVD
08.17.08 / Joe

A Twitter Success Story
Thursday / 04.19.07 / 08:38PM / Joe / comments: 2

I think I have a resolution to the Twitter code problem that's been bugging me for the last few days. Although I reserve the right to develop new issues should obnoxious non-standard browser conflicts demand it.

I did some serious investigation into the Twitter-Code-On-IE thing. If you do a Google search for '"NaN days ago" Twitter', you'll find a couple other confused souls out there. How can something as (temporarily) huge as Twitter drop this shitty code out there and not have it work inside the world's (unfortunately) #1 web browser? It boggles the mind. I guess nobody is using this particular display option. Or, at least, those who are using it know enough how to fix it. Unlike me.

A few more Google searches brought me to PatMyBelly.com, where the proprietor Ant had posted some clever and brief custom code... an adaptation of the Twitter-supplied stuff with the bonus of actually working in more than one browser. This code even includes nifty back-and-forth buttons to page through the last ten messages, which makes it very similar to Twitter's own Flash solution without being ugly and permanently set to a weird, unusable size.

So last night I set to work adapting the PatMyBelly code to work within the word balloon design I had already created. (IT'S LIKE THE LOGO IS TALKING, GET IT.) The big hurdle was figuring out how to twist the code into working with a table of images, since the original is all text based. Safari and IE handle table imagery in subtle yet annoying ways. In Safari, you can declare background images in just about any portion, the TABLE, the TR or the TD. IE isn't as forgiving; it just wants the TABLE or TD. I had to use background graphics to simulate the "dimmed arrow" look when you can't page further forward or backward. What's actually happening there is that the dimmed arrow is part of a background image, which, should paging be active, is then covered with a lit arrow image.

It's probably the worst way in the world to handle something like that, so pro coders the world over can begin laughing now.

Anyway, once I figured out the precise language so that the table displayed properly in Safari and in Explorer, then I realized that the timestamp was incorrect. It was showing a two-hour-old message as being from "about a minute ago." The implication being that I played Baten Kaitos at two in the morning, gasp. That's better than defaulting to "NaN days ago," sure, but still undesireable.

The vagaries of javascript time functions are above my head, so I posted a message to PatMyBelly and received a reply with corrected code within hours. Turns out, Ant had not included a line to handle adjustment for different time zones. Crazy! I never would have figured that out; I probably would have just moved to French Guiana, where the timestamps would have been correct. With the fix applied, the Twitters all sorted themselves into a more chronologically accurate position, so people tracking my Baten Kaitos play can breathe a now-accurate sigh of relief.

So the main reason behind this entry is to give a big shout out of thanks to PatMyBelly.com, who, in addition to hosting a sweet Twitter code solution, also sports a kickingly colorful weblog design.

And, secondarily, to get this info into Google so future webloggers pissed off by Twitter can search themselves closer to fixing the problem. The truth is out there. You don't have to put up with NaN Days Ago anymore.

 

comments

fourhman.com allows registered commenting from TypeKey, VOX, OpenID, LiveJournal and AIM.

Author Profile Page UnknownVariable / 04.20.07 / 08:28PM /

JavaScript is usually the hardest to get correct on all browsers unless you're really trained in the stuff. I'm a web developer, and I disregarded cross-browser compatible javascript when I first started, so I had a lot of trouble later on when I was testing it all. Granted, that was years ago, so now I write the code correctly on the first shot. ;) (or at least, with only minor tweaking, haha)

I do have to say though, whenever I use "premade" code from somebody else for some widget or similar (like in the case with twitter) I always end up recoding it all for myself as it's usually broken on a lot of browsers.


Author Profile Page Ant / 05.02.07 / 11:15AM /

Sorry for the delay. Thank you so much for the shout out! It's very much appreciated. Glad the code helped you out - let me know if there's anything else I can help with.


    previous entry   next entry      
prev   The easiest, stupidest thing on the internet.
04.17.07
  $64 on comics
04.20.07
  next

This entry is tagged: fourhman.com Twitter [browse all tags on fourhman.com]

weblog features
>AC Wild World Diary / 28 entries
>Animal Crossing Log / 31 entries
>Farewell to the GameCube / 18 entries
>Farewell to the PS2 / 23 entries
>Gumby Book of Letters / 7 entries
>Our Trip to Korea / 7 entries
>Pokemon LeafNotes / 17 entries
>Pokemon Pearl Journal / 19 entries
>Pokemon Sapphire Diary / 23 entries
>Sam and Max Hit the Road / 26 entries
>Slashdot Comment History / 7 entries
>Smash Brawl Photos / 16 entries

weblog archive
>August 2008
>July 2008
>June 2008
>May 2008
>April 2008
>March 2008
>February 2008
>January 2008
>December 2007
>November 2007
>October 2007
>September 2007
>August 2007
>July 2007
>June 2007
>May 2007
>April 2007
>March 2007
>February 2007
>January 2007
>December 2006
>November 2006
>October 2006
>September 2006
>August 2006
>July 2006
>June 2006
>May 2006
>April 2006
>March 2006
>February 2006
>January 2006
>December 2005
>November 2005
>October 2005
>September 2005
>August 2005
>July 2005
>June 2005
>May 2005
>April 2005
>March 2005
>February 2005
>January 2005
>December 2004
>November 2004
>October 2004
>September 2004
>August 2004
>July 2004
>June 2004
>May 2004
>April 2004
>March 2004
>February 2004
>January 2004
>December 2003
>November 2003
>October 2003
>September 2003
>August 2003
>July 2003
>June 2003
>May 2003
>April 2003
>March 2003
>February 2003
>January 2003
>December 2002
>November 2002
>October 2002
>September 2002
>August 2002
>July 2002
>June 2002
>May 2002
>April 2002
>March 2002
>February 2002
>January 2002
>September 2001
>August 2001
>July 2001
>June 2001
>May 2001
>April 2001
>March 2001
>February 2001
>January 2001
>December 2000
>November 2000
>October 2000
>September 2000
>August 2000
>May 2000
>April 2000
>February 2000
>November 1999
>June 1999
>February 1999
>December 1998
>November 1998
>March 1998
>February 1998
 
Play-Asia.com - Buy Video Games for Consoles and PC - From Japan, Korea and other Regions!

[fourhman.com home] jump to top