<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Colorize your election party</title>
	<atom:link href="http://hackaday.com/2008/11/03/colorize-your-election-party/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackaday.com/2008/11/03/colorize-your-election-party/</link>
	<description>Fresh hacks every day</description>
	<lastBuildDate>Fri, 10 Feb 2012 16:05:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: DMXExplained</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-83498</link>
		<dc:creator><![CDATA[DMXExplained]]></dc:creator>
		<pubDate>Wed, 29 Jul 2009 21:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-83498</guid>
		<description><![CDATA[Better add the link :P]]></description>
		<content:encoded><![CDATA[<p>Better add the link :P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DMXExplained</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-83497</link>
		<dc:creator><![CDATA[DMXExplained]]></dc:creator>
		<pubDate>Wed, 29 Jul 2009 21:48:58 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-83497</guid>
		<description><![CDATA[Btw, if anyone is wondering what dmx is, check my link.]]></description>
		<content:encoded><![CDATA[<p>Btw, if anyone is wondering what dmx is, check my link.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macegr</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49109</link>
		<dc:creator><![CDATA[macegr]]></dc:creator>
		<pubDate>Wed, 05 Nov 2008 03:31:15 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49109</guid>
		<description><![CDATA[I put up a howto for my election meter, It&#039;s sitting over the fireplace right now showing the results: http://www.macetech.com/blog/node/67]]></description>
		<content:encoded><![CDATA[<p>I put up a howto for my election meter, It&#8217;s sitting over the fireplace right now showing the results: <a href="http://www.macetech.com/blog/node/67" rel="nofollow">http://www.macetech.com/blog/node/67</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mastahyeti</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49084</link>
		<dc:creator><![CDATA[Mastahyeti]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 20:47:02 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49084</guid>
		<description><![CDATA[I modified their code to make a live election ticker. 
import urllib2
import re
import os
import time

def ElectionWon(winner):
  while 1:print winner, &quot; WIN!!!!!!&quot;

class CNN(object):
  def __init__(self):
    self.url = &quot;http://www.cnn.com/ELECTION/2008/results/president/&quot;

  def get(self):
    &quot;&quot;&quot;return the electoral balance
        (dpopular, delectoral), (rpopular, relectoral)
    &quot;&quot;&quot;
    u = urllib2.urlopen(self.url)
    for line in u.readlines():
      res = re.search(r&#039;var CNN_NData=(.*?);&#039;, line)
      if res is not None:
        data = res.group(1)
        data = data.replace(&quot;true&quot;, &quot;True&quot;)
        data = data.replace(&quot;false&quot;, &quot;False&quot;)
        data = eval(data)

        d,r = None, None
        for candidate in data[&#039;P&#039;][&#039;candidates&#039;]:
          if candidate[&#039;party&#039;] == &#039;D&#039;:
            d = candidate[&#039;votes&#039;], candidate[&#039;evotes&#039;]
            if candidate[&#039;winner&#039;]:
              ElectionWon(&quot;DEMOCRATS&quot;)
          elif candidate[&#039;party&#039;] == &#039;R&#039;:
            r = candidate[&#039;votes&#039;], candidate[&#039;evotes&#039;]
            if candidate[&#039;winner&#039;]:
              ElectionWon(&quot;REPUBLICANS&quot;)
    if d[1] &gt; r[1]: leader = &quot;&lt;&lt;&lt;&lt;&lt; d[1]: leader = &quot;&gt;&gt;&gt;&gt;&gt;&gt;&quot;
    if d == r: leader = &quot;------&quot;
    print &quot;Democrats Popular:&quot;,d[0],&quot; Democrats Electoral:&quot;,d[1],leader,&quot; Republicans Popular:&quot;,r[0],&quot; Republicans Electoral:&quot;,r[1]
    return 0

if __name__==&#039;__main__&#039;:
  cnn = CNN()
  os.system(&quot;clear&quot;)
  while 1:
    cnn.get()
    time.sleep(2)
    os.system(&quot;clear&quot;)
&quot;&quot;&quot;DOS users should replace &#039;clear&#039; with &#039;cls&#039;&quot;&quot;&quot;]]></description>
		<content:encoded><![CDATA[<p>I modified their code to make a live election ticker.<br />
import urllib2<br />
import re<br />
import os<br />
import time</p>
<p>def ElectionWon(winner):<br />
  while 1:print winner, &#8221; WIN!!!!!!&#8221;</p>
<p>class CNN(object):<br />
  def __init__(self):<br />
    self.url = &#8220;http://www.cnn.com/ELECTION/2008/results/president/&#8221;</p>
<p>  def get(self):<br />
    &#8220;&#8221;"return the electoral balance<br />
        (dpopular, delectoral), (rpopular, relectoral)<br />
    &#8220;&#8221;"<br />
    u = urllib2.urlopen(self.url)<br />
    for line in u.readlines():<br />
      res = re.search(r&#8217;var CNN_NData=(.*?);&#8217;, line)<br />
      if res is not None:<br />
        data = res.group(1)<br />
        data = data.replace(&#8220;true&#8221;, &#8220;True&#8221;)<br />
        data = data.replace(&#8220;false&#8221;, &#8220;False&#8221;)<br />
        data = eval(data)</p>
<p>        d,r = None, None<br />
        for candidate in data['P']['candidates']:<br />
          if candidate['party'] == &#8216;D&#8217;:<br />
            d = candidate['votes'], candidate['evotes']<br />
            if candidate['winner']:<br />
              ElectionWon(&#8220;DEMOCRATS&#8221;)<br />
          elif candidate['party'] == &#8216;R&#8217;:<br />
            r = candidate['votes'], candidate['evotes']<br />
            if candidate['winner']:<br />
              ElectionWon(&#8220;REPUBLICANS&#8221;)<br />
    if d[1] &gt; r[1]: leader = &#8220;&lt;&lt;&lt;&lt;&lt; d[1]: leader = &#8220;&gt;&gt;&gt;&gt;&gt;&gt;&#8221;<br />
    if d == r: leader = &#8220;&#8212;&#8212;&#8221;<br />
    print &#8220;Democrats Popular:&#8221;,d[0],&#8221; Democrats Electoral:&#8221;,d[1],leader,&#8221; Republicans Popular:&#8221;,r[0],&#8221; Republicans Electoral:&#8221;,r[1]<br />
    return 0</p>
<p>if __name__==&#8217;__main__&#8217;:<br />
  cnn = CNN()<br />
  os.system(&#8220;clear&#8221;)<br />
  while 1:<br />
    cnn.get()<br />
    time.sleep(2)<br />
    os.system(&#8220;clear&#8221;)<br />
&#8220;&#8221;"DOS users should replace &#8216;clear&#8217; with &#8216;cls&#8217;&#8221;"&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DarkFader</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49083</link>
		<dc:creator><![CDATA[DarkFader]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 20:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49083</guid>
		<description><![CDATA[it better turn green]]></description>
		<content:encoded><![CDATA[<p>it better turn green</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliott</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49081</link>
		<dc:creator><![CDATA[Elliott]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 20:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49081</guid>
		<description><![CDATA[what kind of numbers does this return? i want to do something with this but am not good enough at python to get it from reading the code. thanks in advanced.]]></description>
		<content:encoded><![CDATA[<p>what kind of numbers does this return? i want to do something with this but am not good enough at python to get it from reading the code. thanks in advanced.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jfernsler</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49070</link>
		<dc:creator><![CDATA[jfernsler]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 17:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49070</guid>
		<description><![CDATA[I added a touch of code to the python scrape to convert the normalized values into hex color codes and send that over serial to my arduino. 

I&#039;d say it works well, but we&#039;re still at 0,0 :)

but hey, no dmx, just arduino and a few red and blue leds.]]></description>
		<content:encoded><![CDATA[<p>I added a touch of code to the python scrape to convert the normalized values into hex color codes and send that over serial to my arduino. </p>
<p>I&#8217;d say it works well, but we&#8217;re still at 0,0 :)</p>
<p>but hey, no dmx, just arduino and a few red and blue leds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fartface</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49063</link>
		<dc:creator><![CDATA[fartface]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 14:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49063</guid>
		<description><![CDATA[Grab a couple of super bright red led&#039;s and a couple of super bright BLue LED&#039;s 

write a simple pic project to modulate them and get data via rs232.   use a pc to collect the data  and send the numbers to the pic.

same thing in 20 minutes and far less money spent.

will you fill a room full of light? no, but then the DMX lighting setup will run several hundred anyways.]]></description>
		<content:encoded><![CDATA[<p>Grab a couple of super bright red led&#8217;s and a couple of super bright BLue LED&#8217;s </p>
<p>write a simple pic project to modulate them and get data via rs232.   use a pc to collect the data  and send the numbers to the pic.</p>
<p>same thing in 20 minutes and far less money spent.</p>
<p>will you fill a room full of light? no, but then the DMX lighting setup will run several hundred anyways.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macegr</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49054</link>
		<dc:creator><![CDATA[macegr]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 10:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49054</guid>
		<description><![CDATA[Yay, it&#039;s working! Okay: 32 RGB ShiftBrite modules in a row, running off a Cubloc CB405, receiving data over a Bluetooth connection from a Linux box running in a closet. That box is running a modified version of the CNN scraper. I&#039;m using the 32 LEDs as a bar graph, and I have two red 2&quot; 4-digit 7 segment displays showing the actual electoral counts. Just going to tack this all to a plank tomorrow, it&#039;s ready! Pics: http://www.flickr.com/photos/macetech/3001651751/]]></description>
		<content:encoded><![CDATA[<p>Yay, it&#8217;s working! Okay: 32 RGB ShiftBrite modules in a row, running off a Cubloc CB405, receiving data over a Bluetooth connection from a Linux box running in a closet. That box is running a modified version of the CNN scraper. I&#8217;m using the 32 LEDs as a bar graph, and I have two red 2&#8243; 4-digit 7 segment displays showing the actual electoral counts. Just going to tack this all to a plank tomorrow, it&#8217;s ready! Pics: <a href="http://www.flickr.com/photos/macetech/3001651751/" rel="nofollow">http://www.flickr.com/photos/macetech/3001651751/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darthur</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49049</link>
		<dc:creator><![CDATA[darthur]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 09:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49049</guid>
		<description><![CDATA[Any ideas as to how to get state by state percentages?  They appear to be burried in one of the other files that the html links to.]]></description>
		<content:encoded><![CDATA[<p>Any ideas as to how to get state by state percentages?  They appear to be burried in one of the other files that the html links to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: werejag</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49047</link>
		<dc:creator><![CDATA[werejag]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 08:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49047</guid>
		<description><![CDATA[eric gradman

can you give more details on the trs80 mod]]></description>
		<content:encoded><![CDATA[<p>eric gradman</p>
<p>can you give more details on the trs80 mod</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macegr</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49040</link>
		<dc:creator><![CDATA[macegr]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 07:05:24 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49040</guid>
		<description><![CDATA[I&#039;m parsing the data now, but the tough part is I&#039;m not sure what the format of the popular vote variable will be. Maybe it&#039;s a plain number, maybe it&#039;s thousands-separated, etc. I guess I will have to tune the code a little bit tomorrow. But the physical construction is next....]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m parsing the data now, but the tough part is I&#8217;m not sure what the format of the popular vote variable will be. Maybe it&#8217;s a plain number, maybe it&#8217;s thousands-separated, etc. I guess I will have to tune the code a little bit tomorrow. But the physical construction is next&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: macegr</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49035</link>
		<dc:creator><![CDATA[macegr]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 05:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49035</guid>
		<description><![CDATA[I&#039;m building one of these right now. I&#039;ve got his code running, with some modifications to send the data to a Bluetooth/serial module using rfcomm. It&#039;ll have a red/blue bar graph and large numerical displays with the count at either end. It&#039;s going to look like an 80&#039;s cartoon battle....]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m building one of these right now. I&#8217;ve got his code running, with some modifications to send the data to a Bluetooth/serial module using rfcomm. It&#8217;ll have a red/blue bar graph and large numerical displays with the count at either end. It&#8217;s going to look like an 80&#8242;s cartoon battle&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gosh</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49034</link>
		<dc:creator><![CDATA[Gosh]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 05:19:48 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49034</guid>
		<description><![CDATA[This is a nifty post, however it would of been nice if it was posted a few days ago. I&#039;m way too drunk to do anything slick with it now.]]></description>
		<content:encoded><![CDATA[<p>This is a nifty post, however it would of been nice if it was posted a few days ago. I&#8217;m way too drunk to do anything slick with it now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eric gradman</title>
		<link>http://hackaday.com/2008/11/03/colorize-your-election-party/comment-page-1/#comment-49031</link>
		<dc:creator><![CDATA[eric gradman]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 04:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://hackadaycom.wordpress.com/?p=5512#comment-49031</guid>
		<description><![CDATA[You can do this tomorrow if you happen to live near a Guitar Center.  Go in a buy a few LED par cans.  Grab some XLR cables.  Buy a DMX controller.  I&#039;m using a ENTTEC DMX USB PRO, which might not be available at Guitar Center, but an alternative certainly is.

Though the DMX protocol is quite simple, it does have some tricky timing.  I&#039;d caution against trying to whip it up from scratch given the fact that it can be done on a computer quite cheaply.

I was actually just integrating the code I posted with the DMX code (from a previous project) and I&#039;ll update the blog entry with the final code shortly.]]></description>
		<content:encoded><![CDATA[<p>You can do this tomorrow if you happen to live near a Guitar Center.  Go in a buy a few LED par cans.  Grab some XLR cables.  Buy a DMX controller.  I&#8217;m using a ENTTEC DMX USB PRO, which might not be available at Guitar Center, but an alternative certainly is.</p>
<p>Though the DMX protocol is quite simple, it does have some tricky timing.  I&#8217;d caution against trying to whip it up from scratch given the fact that it can be done on a computer quite cheaply.</p>
<p>I was actually just integrating the code I posted with the DMX code (from a previous project) and I&#8217;ll update the blog entry with the final code shortly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

