lib/pupil/statuses.rb in pupil-0.6.3 vs lib/pupil/statuses.rb in pupil-0.7
- old
+ new
@@ -8,11 +8,11 @@
# @option param [Symbol] :trim_user
# @option param [Symbol] :include #=> [:rts]
# @option param [Symbol] :exclude #=> [:replies]
# @option param [Symbol] :contributor_details
def timeline(param={})
- response = self.get("/1.1/statuses/home_timeline.json", param)
+ response = self.get("statuses/home_timeline.json", param)
return false unless response
statuses = []
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
@@ -22,11 +22,11 @@
alias_method :home_timeline, :timeline
# @return [Array] Mention
# @param [Hash] param
def mentions(param={})
- response = self.get("/1.1/statuses/mentions_timeline.json", param)
+ response = self.get("statuses/mentions_timeline.json", param)
return false unless response
statuses = []
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
@@ -51,11 +51,11 @@
# twitter = Pupil.new PUPIL_KEY
# twitter.user_timeline(:screen_name => 'o_ame', :exclude => :replies).each do |status|
# puts "#{status.user.screen_name}: #{status.text}"
# end
def user_timeline(target, option={})
- response = self.get("/1.1/statuses/user_timeline.json", {guess_parameter(target) => target}.update(option))
+ response = self.get("statuses/user_timeline.json", {guess_parameter(target) => target}.update(option))
return false unless response
statuses = []
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
@@ -67,100 +67,100 @@
# Returning public timeline
# @return [Array] Timeline
# @param [Hash] param
def public_timeline(param={})
- response = self.get("/1.1/statuses/public_timeline.json", param)
+ response = self.get("statuses/public_timeline.json", param)
return false unless response
statuses = Array.new
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
end
return statuses
end
def retweeted_by_me(param={})
- response = self.get("/1.1/statuses/retweeted_by_me.json", param)
+ response = self.get("statuses/retweeted_by_me.json", param)
return false unless response
statuses = Array.new
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
end
return statuses
end
def retweeted_to_me(param={})
- response = self.get("/1.1/statuses/retweeted_to_me.json", param)
+ response = self.get("statuses/retweeted_to_me.json", param)
return false unless response
statuses = Array.new
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
end
return statuses
end
def retweets_of_me(param={})
- response = self.get("/1.1/statuses/retweets_of_me.json", param)
+ response = self.get("statuses/retweets_of_me.json", param)
return false unless response
statuses = Array.new
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
end
return statuses
end
def retweeted_to_user(param={})
- response = self.get("/1.1/statuses/retweeted_to_user.json", param)
+ response = self.get("statuses/retweeted_to_user.json", param)
return false unless response
statuses = Array.new
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
end
return statuses
end
def retweeted_by_user(param={})
- response = self.get("/1.1/statuses/retweeted_by_user.json", param)
+ response = self.get("statuses/retweeted_by_user.json", param)
return false unless response
statuses = Array.new
response.each do |element|
status = Status.new(element, @access_token)
statuses << status
end
return statuses
end
def oembed(param={})
- response = self.get("/1.1/statuses/oembed.json", param)
+ response = self.get("statuses/oembed.json", param)
return response
end
def status(status_id, param={})
- response = self.get("/1.1/statuses/show/#{status_id}.json", param)
+ response = self.get("statuses/show/#{status_id}.json", param)
return false unless response
status = Status.new(response, @access_token)
return status
end
def update(status, irt='')
response = self.post(
- "/1.1/statuses/update.json",
+ "statuses/update.json",
"status"=> status,
"in_reply_to_status_id" => irt
)
return false unless response
response
end
alias_method :tweet, :update
def destroy(status_id)
- response = self.post("/1.1/statuses/destroy/#{status_id}.json")
+ response = self.post("statuses/destroy/#{status_id}.json")
return false unless response
response
end
end
\ No newline at end of file