hchoroomi (owner)

Fork Of

gist: 21958 by seaofcl... feeling meh? you're not the...

Revisions

gist: 21964 Download_button fork
public
Public Clone URL: git://gist.github.com/21964.git
meh.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require "rubygems"
require "sinatra"
require 'atom' #sudo gem install ratom
require 'net/http'
require 'uri'
 
not_found do
  headers["Status"] = "301 Moved Permanently"
  redirect("/")
end
 
configure do
end
 
get '/' do
  feed_url = 'http://search.twitter.com/search.atom?q=meh'
  @feed = Atom::Feed.new(Net::HTTP::get(URI::parse(feed_url))) #struggling with atom
  # feed = Atom::Feed.load_feed(URI.parse(feed_url)) #struggling with ratom/lib-xml
  haml :index
end
 
# stylesheets
 
get '/main.css' do
  content_type 'text/css', :charset => 'utf-8'
  sass :main
end
 
use_in_file_templates!
 
__END__
 
@@ layout
!!! XML
!!! Strict
%html{ :xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", 'xml:lang' => "en" }
%head
%title meh
%meta{'http-equiv'=>"content-type", :content=>"text/html; charset=UTF-8"}/
%link{:href=>"/main.css", :media=>"all", :rel=>"stylesheet", :type=>"text/css"}/
%script{:type=>"text/javascript"}
:plain
 
%body
.container
#content
= yield
#footer
 
@@ index
%p
- @feed.entries.each do |entry|
%span= entry.title
by
%span= entry.authors.first.name
on
-#%a{:href="#{entry.link}"}= entry.published.strftime('%m/%d/%Y')
@@ main
*
:margin 0
:padding 0
:font-family arial, sans-serif
body
:background-color #777
:color #999
a
:color #999