Sha256: a57045d5eea70ce96f88a5a6356998562f08224419abeadba97784547a4de913

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

module Tw
  class Client

    def mentions
      Twitter.mentions.map{|m|
        {
          :id => m.id,
          :user => m.user.screen_name,
          :text => m.text,
          :time => m.created_at
        }
      }
    end

    def search(word)
      Twitter.search(word).results.map{|m|
        {
          :id => m.id,
          :user => m.from_user,
          :text => m.text,
          :time => m.created_at
        }
      }
    end

    def home_timeline
      Twitter.home_timeline.map{|m|
        {
          :id => m.id,
          :user => m.user.screen_name,
          :text => m.text,
          :time => m.created_at
        }
      }
    end

    def user_timeline(user)
      Twitter.user_timeline(user).map{|m|
        {
          :id => m.id,
          :user => m.user.screen_name,
          :text => m.text,
          :time => m.created_at
        }
      }
    end

    def list_timeline(user,list)
      Twitter.list_timeline(user, list).map{|m|
        {
          :id => m.id,
          :user => m.user.screen_name,
          :text => m.text,
          :time => m.created_at
        }
      }
    end

    def tweet(message)
      res = Twitter.update message
      puts res.text
      puts "http://twitter.com/#{res.user.screen_name}/status/#{res.id}"
      puts res.created_at
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tw-0.0.3 lib/tw/client/request.rb