Permalink
Browse files

get rid of tweet/blog connection

  • Loading branch information...
1 parent 0ea67cd commit 30c06dc552ab2e052f122615a730b3d07b78138e @seamusabshere seamusabshere committed Mar 14, 2012
@@ -1,41 +0,0 @@
- <div id="elsewhere">
- <% cache "brighter_planet_layout/latest_tweet", :expires_in => 43.minutes do %>
- <!-- Cached at <%= Time.now %> -->
- <% tweet = ::BrighterPlanet.layout.latest_tweet -%>
- <% if tweet %>
- <div id="twitter">
- <p>
- <%= auto_link tweet.description.sub('brighterplanet: ', '') %>
- <span>via <%= link_to '@brighterplanet', 'http://twitter.com/brighterplanet' %></span>
- </p>
- </div>
- <% else %>
- <div id="twitter">
- <p>
- Check out our <a href="http://twitter.com/brighterplanet">Twitter feed</a>
- <span>via <a href="http://twitter.com/brighterplanet">@brighterplanet</a></span>
- </p>
- </div>
- <% end %>
- <% end %>
- <% cache "brighter_planet_layout/latest_blog_post", :expires_in => 47.minutes do %>
- <!-- Cached at <%= Time.now %> -->
- <% blog_post = ::BrighterPlanet.layout.latest_blog_post -%>
- <% if blog_post %>
- <div id="blog" class="<%= blog_post.author.downcase.dasherize %>">
- <p>
- <span><%= blog_post.author %> posted</span>
- <%= link_to blog_post.title, blog_post.link %>
- <span><%= time_ago_in_words blog_post.updated %> ago on <%= link_to 'Safety in Numbers', 'http://numbers.brighterplanet.com' %>, our blog</span>
- </p>
- </div>
- <% else %>
- <div id="blog" class="andy">
- <p>
- See <a href="http://numbers.brighterplanet.com">the latest posts</a>
- <span>by Andy on <a href="http://numbers.brighterplanet.com">Safety in Numbers</a>, our blog</span>
- </p>
- </div>
- <% end %>
- <% end %>
- </div>
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency 'simple-rss', '>=1.2.3'
s.add_dependency 'tronprint', '>=1.2.0'
s.add_development_dependency 'test-unit'
end
@@ -1,8 +1,5 @@
-require 'net/http'
-require 'uri'
require 'fileutils'
require 'singleton'
-require 'simple-rss'
#require 'tronprint'
require 'brighter_planet_metadata'
@@ -17,9 +14,6 @@ class Layout
include ::Singleton
GEM_ROOT = ::File.expand_path ::File.join(::File.dirname(__FILE__), '..')
- TWITTER_RSS = 'http://twitter.com/statuses/user_timeline/15042574.rss'
- BLOG_ATOM = 'http://numbers.brighterplanet.com/latest.xml'
- TIMEOUT = 5 # seconds
S3_BUCKET = 'brighterplanetlayout'
def cdn_host(protocol)
@@ -117,18 +111,6 @@ def google_analytics_ua_number
def rails_root
::Rails.respond_to?(:root) ? ::Rails.root : ::RAILS_ROOT
end
-
- def latest_tweet
- ::SimpleRSS.parse(::Net::HTTP.get(::URI.parse(TWITTER_RSS))).entries.first
- rescue ::Exception
- $stderr.puts "[brighter_planet_layout] Can't get latest tweet because of #{$!.inspect}"
- end
-
- def latest_blog_post
- ::SimpleRSS.parse(::Net::HTTP.get(::URI.parse(BLOG_ATOM))).entries.first
- rescue ::Exception
- $stderr.puts "[brighter_planet_layout] Can't get latest blog post because of #{$!.inspect}"
- end
end
end
@@ -23,12 +23,4 @@ class TestBrighterPlanetLayout < Test::Unit::TestCase
def test_application_name
assert_equal 'Foobar', BrighterPlanet.layout.application_name
end
-
- def test_latest_blog_post
- assert !BrighterPlanet.layout.latest_blog_post.empty?
- end
-
- def test_latest_tweet
- assert !BrighterPlanet.layout.latest_tweet.empty?
- end
end

0 comments on commit 30c06dc

Please sign in to comment.