-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<style type="text/css" media="all"> | ||
/*<![CDATA[*/ | ||
#twitter_div { | ||
|
||
position: absolute; | ||
|
||
left: 186px; | ||
|
||
top: 99px; | ||
|
||
width: 576px; | ||
|
||
height: 560px; | ||
|
||
overflow: auto; | ||
|
||
|
||
} | ||
|
||
ul#twitter_update_list { | ||
|
||
list-style: none; | ||
|
||
font-size: 14px; | ||
|
||
|
||
} | ||
|
||
ul#twitter_update_list li { | ||
|
||
margin-bottom: 10px; | ||
|
||
padding: 10px; | ||
|
||
color: #7a8a99; | ||
|
||
background: url(images/transpBlue.png); | ||
|
||
|
||
} | ||
|
||
|
||
|
||
a { | ||
color: #96997a; | ||
|
||
} | ||
|
||
/*]]>*/ | ||
</style> | ||
<div id="twitter_div"> | ||
<h2 class="sidebar-title">Updates</h2> | ||
<ul id="twitter_update_list"></ul> | ||
<div id="twitter_underform"></div> | ||
</div> | ||
<script type="text/javascript"> | ||
/*<![CDATA[*/ | ||
|
||
|
||
function twitterCallback2(C){ | ||
|
||
var A=[]; | ||
for ( var D=0; D<C.length; D++ ) { | ||
var E=C[D].user.screen_name; | ||
var B=C[D].text.replace( | ||
/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, | ||
function(F){ | ||
return'<a href="'+F+'">'+F+"</a>" | ||
}); | ||
|
||
A.push('<li><img width="20" height="20" src="'+C[D].user.profile_background_image_url+"\"><span> "+'<a href="'+C[D].user.url+'">'+E+"</a>"+' '+B+'</span> <a style="font-size:85%" href="'+C[D].id+'">'+relative_time(C[D].created_at)+"</a></li>") | ||
|
||
} | ||
|
||
var forma = '<form method="post" action="<?php base_url(); ?>posts"><input type="hidden" name="method" value="post"><textarea name="post[title]" cols="15" rows="2"></textarea><br><input type="submit" value="Post comment"></form><p style="font-size:10pt;">(<a style="font-size:10pt;" href="<?php base_url(); ?>oauth_login?forward">sign in w/Twitter</a>)</p>'; | ||
|
||
|
||
document.getElementById("twitter_update_list").innerHTML=A.join(""); | ||
document.getElementById("twitter_underform").innerHTML=forma; | ||
|
||
} | ||
function relative_time(C){ | ||
|
||
var B = C.split(" "); | ||
|
||
C = B[1]+" "+B[2]+", "+B[5]+" "+B[3]; | ||
|
||
var A =Date.parse(C); | ||
|
||
var D =(arguments.length>1)?arguments[1]:new Date(); | ||
|
||
var E =parseInt((D.getTime()-A)/1000); | ||
|
||
//E = E + ( D.getTimezoneOffset()*60 ); | ||
|
||
if (E<60){return"less than a minute ago" | ||
}else{ | ||
if (E<120){return"about a minute ago" | ||
}else{ | ||
if (E<(60*60)){return(parseInt(E/60)).toString()+" minutes ago" | ||
}else{ | ||
if (E<(120*60)){return"about an hour ago" | ||
}else{ | ||
if (E<(24*60*60)){return"about "+(parseInt(E/3600)).toString()+" hours ago"} | ||
else{if(E<(48*60*60)){return"1 day ago"} | ||
else{return(parseInt(E/86400)).toString()+" days ago" | ||
}}}}}}}; | ||
|
||
|
||
/*]]>*/ | ||
</script> | ||
<script type="text/javascript" src="<?php base_url(); ?>api/statuses/public_timeline.json?callback=twitterCallback2& | ||
count=5"> | ||
</script> | ||
|