Skip to content
Browse files

Initital commit

  • Loading branch information...
0 parents commit 20008d8d453f851c912bcfde796349a9eecf10f5 @nathanhoad committed Jun 5, 2010
Showing with 40 additions and 0 deletions.
  1. +3 −0 Gemfile
  2. +10 −0 app.rb
  3. +2 −0 config.ru
  4. BIN public/images/barcamp.jpg
  5. +6 −0 public/stylesheets/application.css
  6. +19 −0 views/index.erb
3 Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+
+gem 'twitter'
10 app.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+require 'sinatra'
+require 'twitter'
+require 'erb'
+
+
+get '/' do
+ @tweets = Twitter::Search.new('#barcampbne')
+ erb :index
+end
2 config.ru
@@ -0,0 +1,2 @@
+require 'app'
+run Sinatra::Application
BIN public/images/barcamp.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 public/stylesheets/application.css
@@ -0,0 +1,6 @@
+html, body { font-family: Georgia, Times, serif; margin: 0; padding: 0; }
+h1 { border-bottom: 3px solid #ccc; margin: 0 auto 40px auto; padding: 0 0 20px 0; width: 480px; }
+ul { list-style: none; margin: auto; padding: 0; width: 480px; }
+li { margin: 0 0 40px 0; }
+h2 { color: #222; font-size: 23px; font-weight: normal; margin: 0 0 10px 0; padding: 0; }
+p { color: #444; font-family: Helvetica; font-size: 14px; margin: 0 0 10px 0; padding: 0; }
19 views/index.erb
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html>
+<head>
+ <title>BarCamp Brisbane Tweets</title>
+ <link rel="stylesheet" type="text/css" href="/stylesheets/application.css" />
+</head>
+<body>
+ <h1><img src="/images/barcamp.jpg" alt="Tweets about BarCamp Brisbane" /></h1>
+ <ul>
+ <% @tweets.each do |tweet| %>
+ <li>
+ <h2><%= tweet.text %></h2>
+ <p>@<%= tweet.from_user %></p>
+ </li>
+ <% end %>
+ </ul>
+</body>
+</html>

0 comments on commit 20008d8

Please sign in to comment.
Something went wrong with that request. Please try again.