Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initital commit

  • Loading branch information...
commit 20008d8d453f851c912bcfde796349a9eecf10f5 0 parents
@nathanhoad authored
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>
Please sign in to comment.
Something went wrong with that request. Please try again.