Class: SocialCurrent::TwitterService

Inherits:
Service
  • Object
show all
Includes:
HTTParty, Twitter::Autolink
Defined in:
lib/social_current/twitter_service.rb

Instance Method Summary collapse

Methods inherited from Service

#fetch, #initialize

Constructor Details

This class inherits a constructor from SocialCurrent::Service

Instance Method Details

#raw_streamObject



12
13
14
# File 'lib/social_current/twitter_service.rb', line 12

def raw_stream
  fetch("/statuses/user_timeline.json?&screen_name=#{@user}", "#{@user}_twitter_raw_stream.json")
end

#raw_userObject



8
9
10
# File 'lib/social_current/twitter_service.rb', line 8

def raw_user
  fetch("/users/show.json?screen_name=#{@user}", "#{@user}_twitter_raw_user.json")
end

#streamObject



16
17
18
19
20
# File 'lib/social_current/twitter_service.rb', line 16

def stream
  raw_stream.collect do |s|
    { :message => format_message(s), :created_at => Time.parse(s["created_at"]).utc, :service => "twitter" }
  end
end