Skip to content

Instantly share code, notes, and snippets.

@esmooov
Forked from ashaw/.gitignore
Created September 10, 2010 19:53
Show Gist options
  • Save esmooov/574264 to your computer and use it in GitHub Desktop.
Save esmooov/574264 to your computer and use it in GitHub Desktop.
<style>
.retweet{
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background-attachment:scroll;
background-color:#d6d6d6;
background-image:none;
background-position:0 0;
background-repeat:repeat;
font-size:11px;
line-height:13px;
padding-left:3px;
padding-right:3px;
padding-top:1px;
padding-bottom:1px;
text-decoration:none;
}
.retweet:hover{
background-color:#cecece;
}
.retweet a{
color:#990000;
font-family:Helvetica,arial,sans-serif;
}
.retweet a:hover{
text-decoration:none;
}
#twire li{
padding:5px;
position:relative;
width:100%;
margin-bottom:10px;
}
#twire li.even{
background-color:#eee;
}
#twire li.odd{
background-color:#fff;
}
#twire ul{
padding:0px;
list-style-type: none;
line-height:20px;
}
.tweetpic{
width:50px;
height:50px;
margin-right:10px;
border: 1px solid #666;
float:left;
}
.textwrapper{
float:left;
width:88%;
}
.twitpic{
height:150px;
width:150px;
float:left;
margin-bottom:10px;
margin-right:10px;
}
#Blurb_1 h2.twohed{
line-height:28px;
}
.tweeter{
width:100%;
}
.tweeter .textwrapper{
width:35%;
}
.tweeter .tweetpic{
margin:7px;
border:none;
width:35px;
height:35px;
}
</style>
<div id="wrapper">
<h2 class="eyebrow"><span class="tpmred">TPM</span> Live Updates</h2>
<div id="shadow_congress_map">
<div class="storywrap" id="twire" style="padding:10px;height:95%;">
<h2 class="twohed"><a href=""><%= @title %></a></h2>
<p> </p>
<ul class="widewire">
<% @tweets.each_with_index do |tweet,index| %>
<li <%= index%2 == 0 ? "class='even'" : "class='odd'" %> >
<div class = "tweetpic" style="background:url('<%= tweet[:userpic] %>')">
</div>
<div class = "textwrapper">
<span class="widewiredate"><a href="http://twitter.com/<%=tweet[:user]%>" target="_blank"><%=tweet[:user]%></a> | <%= tweet[:created_at] %> &mdash;
</span>
<span class="widewireblurb">
<%= tweet[:text] %> <%if tweet[:url] %><span class="retweet"><a href="<%= tweet[:url] %>">Read more &raquo;</a></span> <%end%>
<span class="retweet"><a href="http://twitter.com/?status=RT+@<%=USER%>+<%=CGI::escape(tweet[:original_text])%>">RT</a>
</span>
</span>
</div>
<div style="clear:both"></div>
</li>
<% end %>
</ul>
</div>
</div>
</div>
<div class="shadow_congress_container" id="Blurb_1">
<h2 class="twohed" style="color:#990000">Who's Tweeting</h2>
<div style="border:1px solid #cecece">
<% @tweeters.each_with_index do |tweeter,index| %>
<div class = "tweeter">
<a href="http://twitter.com/<%= tweeter[0] %>" target="_blank">
<div class = "tweetpic" style="background:url('<%= tweeter[1] %>')">
</div>
</a>
<div class = "textwrapper">
<a href="http://twitter.com/<%= tweeter[0] %>" target="_blank">
<p style="font-weight:bold;color:#990000;line-height:12px;"><%= tweeter[0] %></p>
</a>
</div>
<% if (index+1)%2 == 0 %>
<div style="clear:both"></div>
<% end %>
</div>
<% end %>
</div>
<h2 class="twohed" style="color:#990000">Pictures On The Wire</h2>
<% @tweets.each do |tweet| %>
<% if tweet[:twitpic] %>
<a href="http://twitpic.com/<%= tweet[:twitpic] %>" target="_blank"><div class="twitpic" style="background:url('http://twitpic.com/show/thumb/<%= tweet[:twitpic] %>')"></div></a>
<% end %>
<% end %>
<p>
</p>
</div>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="shortcut icon" href="http://www.talkingpointsmemo.com/images/fav1020.png" type="image/ico">
<link type="text/css" rel="stylesheet" href="http://www.talkingpointsmemo.com/tpm1020-inside.css?v=2.10">
<link type="text/css" rel="stylesheet" href="http://www.talkingpointsmemo.com/jqm.css">
<!--[if lte IE 7]>
<link type="text/css" rel="stylesheet" href="http://www.talkingpointsmemo.com/tpm1020-ie.css">
<![endif]-->
<!--[if IE 6]>
<link type="text/css" rel="stylesheet" href="http://www.talkingpointsmemo.com/tpm1020-ie6.css">
<![endif]-->
<!--[if IE]>
<style>
.mainblog_box_couch {
display:inline;
}
</style>
<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://www.talkingpointsmemo.com/tpm1020-inside.js?v=2.01" type="text/javascript"></script>
<script src="http://www.talkingpointsmemo.com/jqm.js" type="text/javascript"></script>
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
<!-- /master inside head info -->
<!-- post-specific head info -->
<title>Shadow Congress | TPM Interactive</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta name="Copyright" content="Copyright (c) TPM Media LLC" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="Author" content='TPM Media' />
<meta name="publish_date" content="Tue, 1 Jun 2010 8:41:53 EST" />
<link rel="canonical" href="http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php" />
<link href="http://www.talkingpointsmemo.com/prettydigg/styles/default/styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
$(document).ready(function() {
function actionNotice(message) {
$('.notice').addClass('activenotice');
$('.notice').append(message);
setTimeout(function(){ $(".notice").fadeOut() }, 5000);
}
$('#mailform').jqm();
});
</script>
<style>
h1,h2 { margin-left:0 !important;margin-right:0 !important; }
</style>
<!-- /post-specific head info -->
<!-- blog-specific head info -->
<script type="text/javascript" src="http://www.talkingpointsmemo.com/interactive/mt.js"></script>
<script language="JavaScript" src="http://partner.googleadservices.com/gampad/google_service.js">
</script>
<script language="JavaScript">
GS_googleAddAdSenseService("ca-pub-7451232131633930");
GS_googleEnableAllServices();
</script>
<script language="JavaScript">
GA_googleAddSlot("ca-pub-7451232131633930", "NewsPage-Leader");
GA_googleAddSlot("ca-pub-7451232131633930", "NewsPage-SecondBox");
GA_googleAddSlot("ca-pub-7451232131633930", "NewsPage-TopBox");
GA_googleAddSlot("ca-pub-7451232131633930", "MapSponsor");
GA_googleAddSlot("ca-pub-7451232131633930", "skin1020");
GA_googleAddSlot("ca-pub-7451232131633930", "Curtain-non-home");
</script>
<script language="JavaScript">
GA_googleFetchAds();
</script>
<script>
//mt
mtAttachEvent('load', mtUpdateScores);
mtAttachEvent('usersignin', mtUpdateScores);
</script>
</head>
<!-- /blog-specific head info -->
<!-- master site header w/ blog-specific vars -->
<!-- MODAL LOGIN -->
<link rel="stylesheet" href="http://talkingpointsmemo.com/modal_login.css" />
<!-- /MODAL LOGIN -->
</head>
<body>
<script src="http://auth.talkingpointsmemo.com/loginbar.js?pagetype=1020"></script>
<div class="container_12 ">
<!-- top matter -->
<div class="nameplate top">
<a href="http://www.talkingpointsmemo.com"><img src="http://www.talkingpointsmemo.com/images/logo-258x120.gif"></a>
</div>
<div class="righttop top">
<div id="dogear"><img src="http://www.talkingpointsmemo.com/images/dogear.png"></div>
<div id="header">
<ul class="mainnav">
<li class="first"><a href="http://tpmmuckraker.talkingpointsmemo.com" title="TPMMuckraker"><span class="tpmred">TPM</span>Muckraker</a> | </li>
<li><a href="http://tpmdc.talkingpointsmemo.com" title="TPMDC"><span class="tpmred">TPM</span>DC</a> | </li>
<li><a href="http://tpmlivewire.talkingpointsmemo.com" title="TPMLiveWire"><span class="tpmred">TPM</span>LiveWire</a> | </li>
<li><a href="http://polltracker.talkingpointsmemo.com" title="TPMPollTracker"><span class="tpmred">TPM</span>PollTracker</a> | </li>
<li><a href="http://tpmtv.talkingpointsmemo.com" title="TPMtv"><span class="tpmred">TPM</span>tv</a> | </li>
<li><a href="http://tpmcafe.talkingpointsmemo.com" title="TPMCafe"><span class="tpmred">TPM</span>Caf&eacute;</a></li>
</ul>
<div id="mainnavright">
<ul class="mainnavright">
<li>
<script type="text/javascript">
//<![CDATA[
<!--
var x="function f(x){var i,o=\"\",ol=x.length,l=ol;while(x.charCodeAt(l/13)!" +
"=92){try{x+=x;l+=l;}catch(e){}}for(i=l-1;i>=0;i--){o+=x.charAt(i);}return o" +
".substr(0,ol);}f(\")75,\\\"dnfuyd8wk%%=700\\\\r\\\"\\\\'*000\\\\mw;'(ng51*&" +
"/,/|630\\\\YR^i700\\\\230\\\\kEE]g220\\\\BGJ`r\\\\HEKt\\\\[SH@INMb000\\\\{p" +
"kU \\\\\\\\C030\\\\020\\\\710\\\\320\\\\r\\\\XU*030\\\\330\\\\020\\\\\\\\\\" +
"\\630\\\\530\\\\n\\\\300\\\\630\\\\030\\\\500\\\\300\\\\600\\\\030\\\\000\\" +
"\\010\\\\410\\\\710\\\\710\\\\300\\\\520\\\\ 42<(a5-4>78v710\\\\o75=&m-wha&" +
"+#1-15o4Q[PIXU]\\\"(f};o nruter};))++y(^)i(tAedoCrahc.x(edoCrahCmorf.gnirtS" +
"=+o;721=%y;2=*y))y+75(>i(fi{)++i;l<i;0=i(rof;htgnel.x=l,\\\"\\\"=o,i rav{)y" +
",x(f noitcnuf\")" ;
while(x=eval(x));
//-->
//]]>
</script>
</li>
</ul>
</div>
<br />
<div class="seventwentyeight">
<!-- PUT THIS TAG IN DESIRED LOCATION OF SLOT MainPage-Leader -->
<script type="text/javascript">
GA_googleFillSlot("NewsPage-Leader");
</script>
</div>
</div>
</div>
<div class="clear"></div>
<div class="grid_12 profile-bar">
<div id="profile-bar-2">
<div class="links_left" id="signin-bar"></div>
<div class="links_right">
<!-- GOOGLE CUSTOM SEARCH
<form action="http://www.talkingpointsmemo.com/gsearch.php" id="cse-search-box">
<input type="hidden" name="cx" value="000394124366365696456:cuidxoyvru8" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" class="searchpopbox"/>
<input type="submit" name="sa" value="Go" class="searchpop" onmouseover="this.className='searchpophover'" onmouseout="this.className='searchpop'"/>
-->
<!-- MT SEARCH -->
<form name="search" method="get" action="http://www.talkingpointsmemo.com/cgi-bin/mt-current/mt-search.cgi" id="cse-search-box">
<input type="hidden" name="IncludeBlogs" value="2" />
<!--input type="hidden" name="Template" value="mtdocs" /-->
<!-- input type="hidden" name="ResultDisplay" value="ascend" / -->
<input name="search" type="text" value="" class="searchpopbox"/>
<input type="submit" value="Search" class="searchpop" />
</form>
<a href="http://www.talkingpointsmemo.com/about.php" title="About TPM" class="tpmred">About</a> |
<a href="http://talkingpointsmemo.com/rssfeeds.php" title="TPM RSS feed" class="tpmred">RSS</a>
</div>
</div>
</div>
<div class="clear"></div>
<!-- /top matter -->
<div class="curtain_outer">
<div class="curtain">
<script type="text/javascript">
GA_googleFillSlot("curtain-home");
</script>
</div>
</div>
<!-- / master site header w/ blog-specific vars -->
<!-- /top matter -->
<!-- PAGE -->
<div class="grid_12"> <!-- marquee -->
<div class="notice"></div>
</div> <!-- /marquee -->
<div class="grid_12 post_body dc_postbody"> <!-- post body -->
<h1 style="border-bottom: 1px solid #cecece;padding-bottom:5px;">
<img src="/interactive/shadow-congress-hed.png" alt="Shadow Congress" />
</h1>
<!-- CONTENT -->
<style>/* shadow congress */
#shadow_congress_map {
width:620px;float:left;margin-right:15px;margin-top:2px;
}
h2.alpha_hed {
font-size:16px;
margin-bottom:15px;
padding-top:3px;
line-height:20px;
}
.navdiv{
clear:both;
}
.shadow_congress_container{
padding-top:2px;
height:473px;
width:365px;
display:none;
line-height:0;
float:left
}
.shadow_congress_container p {
margin-left:0;
}
#Blurb_1{
display:block;
padding-top:10px;
}
</style>
<!--[if lte IE 7]>
<style>
.shadow_congress_hedshot, .shadow_congress_hedshot img,.shadow_congress_details {
display:inline !important;
}
</style>
<![endif]-->
<?php include "tpm_twitter_wire_tpmmedia.php"; ?>
<!-- /CONTENT -->
<div style="clear:left;"></div>
<div class="mainblog_share_footer" style="margin-left:0;float:left;width:330px;">
<h3 class="meta_hed">&nbsp;</h3>
<div class="icons">
<div style="float: left; margin-top: -2px;margin-right:10px"id="diggchicklet"></div>
<a href="http://talkingpointsmemo.com/twitter_share.php?url=http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php"><img src="http://www.talkingpointsmemo.com/images/twitter-button.png" alt="Twitter"/></a>
<a href="http://www.facebook.com/share.php?u=http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php/&h=Shadow%20Congress"><img src="http://www.talkingpointsmemo.com/images/facebook-button.png" alt="Facebook"/></a>
<a href="http://www.fark.com/cgi/farkit.pl?u=http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php&h=Shadow Congress">
<img src="http://www.talkingpointsmemo.com/images/FarkItButton2_16x16.gif" alt="Fark"></a>
<a href="http://www.reddit.com/submit?url=http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php&title=Shadow%20Congress"><img src="http://www.talkingpointsmemo.com/images/reddit-button.png" alt="Reddit"></a>
<img src="http://www.talkingpointsmemo.com/images/sendtofriend-noicon.gif" class="jqModal" alt="Send to a Friend">
<!-- SEND TO FRIEND
<br><a class="showmailform"><img src="/images/sendtofriend.gif" alt="send to a friend" class="sendtofriend"></a></span>
-->
<div id="mailform" class="jqmWindow">
<h2 style="border-bottom:1px solid #999999;padding-bottom:2px;margin-bottom:10px;">Send to a friend!</h2>
<form action="/scripts/sendmail.php" method="POST">
<p>To email: <input type="text" name="to_email">&nbsp;&nbsp;&nbsp;Your Name: <input type="text" name="from">&nbsp;&nbsp;&nbsp;Your email: <input type="text" name="from_email"></p>
<input name="title" type="hidden" value="Shadow Congress" id="title" />
<input name="url" type="hidden" value="http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php" id="url_to_email" />
<input name="return" type="hidden" value="http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php?emailed=true" id="return_to" />
<p><input type="Submit" name="submit" value="Submit">
<input class="cancel jqmClose" type="button" name="cancel" value="Cancel"></p>
</form>
</div>
</div>
</div>
<div class="mainblog_share_footer" style="margin-left:20px;margin-right:0px;float:right:width:300px;">
<h3 class="meta_hed" style="text-align:right;">&nbsp;</h3>
<h2 class="commentshed" style="text-align:right;margin-top:-3px;">
<style> h2.commentshed a { color:#990000; } </style>
<a href="javascript:void(0)" onclick="return mtScore(337347)" id="scoring-id-337347" class="scoring-scorable"> <span id="scoring-vote-337347" class="scoring-vote">Recommend</span> <span id="scoring-score-label-337347" class="scoring-score-label">Recommend</span> (<span id="scoring-score-337347" class="scoring-score">35</span>) </a>
</h2>
</div>
</div><!-- /post body -->
<!-- sidebar -->
<!-- /sidebar -->
<!-- /PAGE -->
<!-- master site footer -->
<div class="grid_12 bottom">
<div class="footerdivider"></div>
<div id="footer">
<img src="http://www.talkingpointsmemo.com/images/footerbug.gif" alt="TPM" style="float:left;">
<ul>
<li class="first"><a href="/index.php">Home</a></li>
<li><a href="http://talkingpointsmemo.com/termsofuse.php">Terms of Use</a></li>
<li><a href="http://talkingpointsmemo.com/privacy.php">Privacy Policy</a></li>
<li><a href="http://talkingpointsmemo.com/about.php">About TPM</a></li>
<li><a href="http://talkingpointsmemo.com/jobs.php">Jobs and Internships</a></li>
<li><a href="/archive.php">Archive</a></li>
<li><a href="http://talkingpointsmemo.com/advertising">Advertise</a></li>
<li><a href="http://talkingpointsmemo.com/contribute.php">Contribute</a></li>
<li><a href="http://www.talkingpointsmemo.com/faq09.php">FAQ</a></li>
<li><script type="text/javascript">
/* <![CDATA[ */
function hivelogic_enkoder(){var kode=
"kode=\"x=edok})c(edoCrahCmorf.gnirtS=+x;821=+c)0<c(fi;3-)i(tAedoCrahc.edok"+
"=c{)++i;htgnel.edok<i;0=i(rof;''=x;\\\">,**=,40kwjqho1hgrn+wDudkf1hgrnBkwj"+
"qho1hgrn?l+.{@hgrn000\\\\,l+wDudkf1hgrn.,4.l+wDudkf1hgrn@.{~,5@.l>,40kwjqh"+
"o1hgrn+?l>3@l+uri>**@{>%{h@rg000\\\\nf,h+rguFkdpFur1iqjulVw.@>{5;@4f.3,f?i"+
"+>l06l,w+hDrguFkd1fghnrf@,~..>lwkqjohh1rg?n>l@3+lru>i**{@%_>C~jkqu33__3i/k"+
".ujxIngsIxu4ltmxoYz1CA~8>C7i16/iBl.Ao39o/z.kGujxIng4ijkquiC/100\\\\11Aoznt"+
"mrkk4ujBqAoC6.ouxAl--~C(A2D002C6:}qwpunn7xm1tJ}j{lqn7xmHt}qwpunn7xmEt1r100"+
"\\\\4nFxm6t662b1rJ}j{lqn7xm4t:2r4}1{Jqj7lmntx4F4100\\\\332__F;r42D6:}qwpun"+
"n7xm1trE9DrF{1ox0DF0D100\\\\D+e+j2EG|8kn)~{Jy}[x+nGee+eeeFuern)}e}+e{ey}[x"+
"nn~)J|}knFkl|sv~lHxxn7|vwvx}prryuw}ttjjICu}}rxvuej+eoe{F)nEq1je+n}r{000\\"+
"\\7}wnv~lxmF+mntxC(jkqu@%_ghnr%@hgrn\\\"=edok\";kode=kode.split('').revers"+
"e().join('')"
;var i,c,x;while(eval(kode));}hivelogic_enkoder();
/* ]]> */
</script>
</li>
<li><a href="http://status.talkingpointsmemo.com">System Status</a></li>
</ul>
&nbsp;&nbsp;&nbsp;&copy; 2010 TPM Media LLC. All Rights Reserved.
</div>
</div>
<div class="clear"></div> <!-- /goodbye -->
</div> <!-- /container -->
<!-- Start Quantcast tag -->
<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
<script type="text/javascript">_qacct="p-e4jyI3LvAd-Dc";quantserve();</script>
<noscript>
<a href="http://www.quantcast.com/p-e4jyI3LvAd-Dc" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-e4jyI3LvAd-Dc.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a>
</noscript>
<!-- End Quantcast tag -->
<!-- start analytics tag -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-927537-1");
pageTracker._setDomainName("talkingpointsmemo.com");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end analytics tag -->
<!-- chartbeat -->
<script type="text/javascript">
var cbjspath = "static.chartbeat.com/js/chartbeat.js?uid=986&domain=talkingpointsmemo.com&titleLength=200";
var cbjsprotocol = (("https:" == document.location.protocol) ? "https://s3.amazonaws.com/" : "http://");
document.write(unescape("%3Cscript src='"+cbjsprotocol+cbjspath+"' type='text/javascript'%3E%3C/script%3E"))
</script>
<!-- end chartbeat -->
<!-- monolith stats -->
<script type="text/javascript">
$(function() {
$.getJSON('http://monolith.talkingpointsmemo.com/count.js?callback=?',{
url : "http://www.talkingpointsmemo.com/interactive/2010/06/shadow-congress-interactive-graphic.php",
author : "Al Shaw",
title : "Shadow Congress"
},function(data) {
//$("#hit_count").html(data['hits']);
});
});
</script>
<!-- end monolith stats -->
<!--[if IE]>
<style>
#signin-bar {display:block;} /* force ie to show signin-bar on entry pages */
</style>
<![endif]-->
<script type="text/javascript">
var disqus_shortname = 'talkingpointsmemo';
(function () {
var s = document.createElement('script'); s.async = true;
s.src = 'http://www.talkingpointsmemo.com/js/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<!--/master site footer -->
</body>
</html>
<style>
.retweet{
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background-attachment:scroll;
background-color:#e7e7e7;
background-image:none;
background-position:0 0;
background-repeat:repeat;
font-size:11px;
line-height:13px;
padding-left:3px;
padding-right:3px;
padding-top:1px;
padding-bottom:1px;
text-decoration:none;
}
.retweet:hover{
background-color:#cecece;
}
.retweet a{
color:#990000;
font-family:Helvetica,arial,sans-serif;
}
.retweet a:hover{
text-decoration:none;
}
</style>
<div class="storywrap">
<h2 class="eyebrow"><span class="tpmred">TPM</span> Live Updates</h2>
<h2 class="twohed"><a href="">Netroots Nation Wire</a></h2>
<p> </p>
<ul class="widewire">
<% @tweets[0..2].each do |tweet| %>
<li>
<span class="widewiredate"><%= tweet[:created_at] %> &mdash;
</span>
<span class="widewireblurb">
<%= tweet[:text] %> <%if tweet[:url] %><span class="retweet"><a href="<%= tweet[:url] %>">Read more &raquo;</a></span> <%end%>
<span class="retweet"><a href="http://twitter.com/?status=RT+@<%=USER%>+<%=CGI::escape(tweet[:original_text])%>">RT</a></span>
</span>
</li>
<% end %>
</ul>
<p style="text-align:right; margin-bottom:0px; margin-top:2px;">
<a href="http://tpmlivewire.talkingpointsmemo.com/2010/07/live-tweets-from-netroots-nation-featuring-christina-bellantoni.php">See more of Christina's tweets &raquo;</a>
</p>
$KCODE = 'UTF8'
require 'uri'
require 'open-uri'
require 'erb'
require 'rubygems'
require 'curb'
require 'twitter'
require 'twitter-text'
#### RUNNER
if ARGV.empty?
raise "you must enter a user!"
end
#USER = 'cbellantoni'
USER = ARGV[0].to_s
LIST = ARGV[1].to_s
#### LIB
module TwitterWire
class Timeline
include Twitter::Extractor
include Twitter::Autolink
attr_reader :timeline
def initialize
@timeline = Twitter.list_timeline(USER,LIST)
end
def run
slim
linkify
de_short_link
end
def slim
@lean_timeline = []
@timeline.each do |update|
if update['in_reply_to_user_id'] == nil
@lean_timeline << {:created_at => Time.parse(update['created_at']).strftime("%I:%M %p"), :text => update['text'], :id => update['id'], :user => update["user"]["screen_name"], :userpic => update["user"]["profile_image_url"]}
end
end
end
def linkify
urls = []
@lean_timeline.each do |update|
# preserve original tweet
update[:original_text] = update[:text].dup
# extract links into :url
update[:url] = extract_urls(update[:text])[0]
# remove link from tweet itself
update[:text].gsub!(Twitter::Regex[:valid_url],'')
# linkify @ and #
update[:text] = auto_link(update[:text])
# get twitpix
update[:twitpic] = update[:original_text][/http:\/\/twitpic\.com\/([^\s|$]+?)(\s|$)/,1]
end
end
def de_short_link
@lean_timeline.each do |update|
url = update[:url] || nil
if not url.nil?
c = Curl::Easy.new(url)
c.follow_location = true
c.max_redirects = nil
c.perform
update[:url] = c.last_effective_url
end
end
@lean_timeline
end
end
class View
def initialize(timeline)
@tweets = timeline
@title = ARGV[2].to_s || ""
@outfile = File.dirname(__FILE__) + '/' + "tpm_twitter_wire_#{USER}.php"
@template = File.dirname(__FILE__) + '/' + "twitter_wire_full.erb"
end
def to_html
t = File.open(@template)
template = t.read.to_s
@tweeters = @tweets.collect{|tweet| [tweet[:user],tweet[:userpic]]}.uniq
html = ERB.new(template).result(binding)
self.write(html)
t.close
end
def write(html)
f = File.new(@outfile,"w+")
f.write(html)
f.close
end
end
end
# to run everything
def generate_twitter_wire
t = TwitterWire::Timeline.new
t = t.run
v = TwitterWire::View.new(t)
v.to_html
end
generate_twitter_wire()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment