| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Visualizations

Page history last edited by Matt Cooperrider 15 years, 5 months ago

Overview

Visualizations of our data will be the key to getting attention and inspiring action on election day.  Our dev team has created a feed that anybody can query to do anything.  Well almost.  Dave and Andrew are ready to supply whatever feed you need if you ask nicely.

 

Here are our two big needs in this department:

1. Documentation: take a look at our code and document it so that future developers can move right to cranking out a great viz

2. Kickass Visualizations: our feed can support any number of excellent maps.  if yours is the coolest, it'll probably end up on the national news on election night.  for realz.

 

List of Current Projects

Create a new page, describe your vision, and link to it here

 

 

Connect with the team

 

First, check out the project on github: http://github.com/davetroy/votereport/tree/master

 

If you have questions, drop into one of our channels

  • Campfire:
  • IRC: #votereport on freenode

 

Or email the Project Leads

  • Dave Troy: davetroy at gmail dot com
  • Andrew Turner: ajturner at gmail dot com 

 

Documentation

We need a brave volunteer to help write documentation.  Please contact Dave Troy or Andrew Turner, or stop by in #votereport on IRC.

 

Data Model

Start by studying it in the github project:

http://github.com/davetroy/votereport/tree/master/db/schema.rb

 

Here is a simple explanation of the major parts of the model:

 

  • We're accepting reports from four sources: Twitter, SMS, iPhone, and an automated telephone IVR system.
  • Each user of these input methods is represented by a Reporter instance of the appropriate subclass (twitter, sms, iphone, phone) and is stored in the reports table using single table inheritance.
  • In turn each Reporter may have multiple reports stored in the reports table. Reports are associated with various tags and location tags upon saving. Check the schema for the other models in use; their function is fairly obvious from the schema, but if you have questions, ask.
  • The goal is to expose any/all of this data to people who want to make visualizations and mashups, both directly on (hosted with) our platform, and externally via KML or GeoRSS.
  • If you have a visualization idea that cannot be implemented using our API, but would instead work directly on our dataset, please ping us about writing it into our Rails app. We are open to contributions.

 

We need folks who can hit the ground running, are familiar with Rails, and can help further document the data model. Please contact Dave Troy or Andrew Turner, or stop by in #votereport on IRC.

 

API and Available Feeds and Calls

 

You can get data from the system in 3 ways: GeoRSS-Atom, KML, and Microformat hAtom.

 

http://votereport.us/reports.atom

 

looks like

 

!curl

curl "http://localhost:3000/reports.atom"

<feed xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns="http://www.w3.org/2005/Atom">

  <title>#votereport</title>

  <id>http://localhost:3000/reports</id>

  <link type="application/atom+xml" href="http://localhost:3000/reports.atom" rel="self"/>

  <link type="application/vnd.google-earth.kml+xml" href="http://localhost:3000/reports.kml" rel="alternate"/>

  <link type="text/html" href="http://localhost:3000/reports" rel="alternate"/>

  <opensearch:totalResults>14</opensearch:totalResults>

  <opensearch:startIndex>10</opensearch:startIndex>

  <opensearch:itemsPerPage>10</opensearch:itemsPerPage>

  <updated>2008-10-27T23:32:19+00:00</updated>

  <link type="application/atom+xml" href="http://localhost:3000/reports.atom?page=1" rel="first"/>

  <link type="application/atom+xml" href="http://localhost:3000/reports.atom?page=2" rel="next"/>

  <link type="application/atom+xml" href="http://localhost:3000/reports.atom?page=2" rel="last"/>

  <entry>

    <title>SMS User</title>

    <link type="text/html" href="http://localhost:3000/reports/3" rel="alternate"/>

    <id>http://localhost:3000/reports/3</id>

    <updated>2008-10-26T03:15:01Z</updated>

    <author>

      <name>SMS User</name>

    </author>

    <summary>TEST. To sign up 4 daily polling updates, text 538 to shortcode 30644!</summary>

    <category term="{attribute} = "/>

    <category term="{attribute} = "/>

    <category term="{attribute} = SMS"/>

<georss:point>-19.991427 -44.013368</georss:point>

    <content type="html">

TEST. To sign up 4 daily polling updates, text 538 to shortcode 30644!    </content>

  </entry>

</feed>
 
 
http://votereports.com/reports.kml 
returns a NetworkLink:
curl "http://localhost:3000/reports.kml"
<kml xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://earth.google.com/kml/2.2">
  <Document>
    <name>#votereport</name>
    <description>Voting Reports for the 2008 election</description>
    <LookAt>
      <longitude>-110</longitude>
      <latitude>39</latitude>
      <altitude>8900000</altitude>
    </LookAt>
    <NetworkLink>
      <name>#votereport live updating</name>
      <Link>
        <href>http://localhost:3000/?live=1</href>
        <viewRefreshMode>onStop</viewRefreshMode>
      </Link>
    </NetworkLink>
  </Document>
</kml>
 
 
 
<kml xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://earth.google.com/kml/2.2">
  <Document>
    <name>#votereport</name>
    <description>Voting Reports for the 2008 election</description>
    <atom:link type="application/atom+xml" href="http://localhost:3000/reports.atom" rel="alternate"/>
    <atom:link type="text/html" href="http://localhost:3000/" rel="alternate"/>
    <Placemark id="votereport:report:18">
      <name>Bradley Holt</name>
      <description>RT @acarvin: Does anyone know anyone who works at Threadless? Trying to help someone connect with them about the #votereport project. in Senador Petronio Portella Airport, 64000 Timon,  BR</description>
      <Style>
        <IconStyle>
          <Icon>
            <href>http://s3.amazonaws.com/twitter_production/profile_images/52063599/bradley_normal.jpg</href>
          </Icon>
        </IconStyle>
        <LabelStyle>
          <color>ff00aaff</color>
        </LabelStyle>
        <BalloonStyle>
          <text>$[description]</text>
          <textColor>ff000000</textColor>
          <color>ff669999</color>
        </BalloonStyle>
      </Style>
      <atom:author>
        <atom:name>Bradley Holt</atom:name>
      </atom:author>
      <atom:link type="text/html" href="http://localhost:3000/reports/18" rel="alternate"/>
      <ExtendedData>
        <Data name="wait_time">
          <value></value>
        </Data>
        <Data name="score">
          <value></value>
        </Data>
        <Data name="source">
          <value>TWT</value>
        </Data>
      </ExtendedData>
      <address>Senador Petronio Portella Airport, 64000 Timon,  BR</address>
      <TimeStamp>
        <when>2008-10-24T14:18:03Z</when>
      </TimeStamp>
<Point>
<coordinates>-42.823898,-5.0603</coordinates>
</Point>
    </Placemark>
  </Document>
</kml>
 
and then just look at the HTML at http://votereport.us for the hAtom markup in the HTML.
 
All of these support pagination: ?page=3 ... ?page=4 etc. 

 

 

Democracy loves you!

Comments (2)

mikeb said

at 12:41 pm on Oct 29, 2008

Would love to have the tweet_id in the KML. thanks

mikeb said

at 1:39 pm on Oct 29, 2008

Also, I mentioned this on IRC but only the KML has the twitter photo and that is in ascending order. The json is in descending order but lacks location, for now anyway. The zip field is blank. Easiest thing for me would be to reverse the KML so it is in descending order. I can check out the code and do that if it makes sense.

thanks

You don't have permission to comment on this page.