- Latest tweets -
--
-
- - <%= namelink tweet, 25 %> - - <% end %> -
-
- <% Tweet.recent.each do |tweet| %>
-
diff --git a/app/controllers/tweets_controller.rb b/app/controllers/tweets_controller.rb deleted file mode 100644 index 93106d0..0000000 --- a/app/controllers/tweets_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'rss/2.0' -require 'open-uri' - -class TweetsController < ApplicationController - def index - @tweets = Tweet.all order: "created_at DESC" - @nobody = true - end - - def show - @tweet = Tweet.find(params[:id]) - end - - def refresh - open('http://twitter.com/statuses/user_timeline/16676427.rss') do |http| - RSS::Parser.parse(http.read, false).items.each do |item| - unless Tweet.first :conditions => {:link => item.link} - tweet = Tweet.new - tweet.link = item.link - tweet.msg = item.title.gsub(/NS2: /, "") - tweet.created_at = DateTime.parse item.pubDate.to_s - tweet.save - end - end - end - - render text: t(:tweets_refresh) - end -end diff --git a/app/models/tweet.rb b/app/models/tweet.rb deleted file mode 100644 index 6e34819..0000000 --- a/app/models/tweet.rb +++ /dev/null @@ -1,22 +0,0 @@ -# == Schema Information -# -# Table name: tweets -# -# id :integer not null, primary key -# msg :string(255) -# link :string(255) -# created_at :datetime -# updated_at :datetime -# - -class Tweet < ActiveRecord::Base - include Extra - - scope :recent2, :order => "created_at DESC", :limit => 2 - scope :recent, :order => "created_at DESC", :limit => 5 - has_many :comments, :as => :commentable - - def to_s - msg - end -end diff --git a/app/views/tweets/index.html.erb b/app/views/tweets/index.html.erb deleted file mode 100644 index 2d60b49..0000000 --- a/app/views/tweets/index.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% @tweets.each do |item| %> - -
- <%= raw h item.msg %> -
- <%= link_to "Comments: #{item.comments.count}", item %> -- <%= h @tweet.msg %> -
-