Skip to content

Commit

Permalink
Remove Twitter::API::Undocumented#status_activity and #statuses_activity
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Jun 25, 2013
1 parent 98f8cfd commit 7f97081
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 72 deletions.
39 changes: 0 additions & 39 deletions lib/twitter/api/undocumented.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,6 @@ def following_followers_of(*args)
cursor_from_response_with_user(:users, Twitter::User, :get, "/users/following_followers_of.json", args, :following_followers_of)
end

# Returns activity summary for a Tweet
#
# @note Undocumented
# @rate_limited Yes
# @authentication Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Twitter::Tweet] The requested Tweet.
# @param id [Integer] A Tweet ID.
# @param options [Hash] A customizable set of options.
# @example Return activity summary for the Tweet with the ID 25938088801
# Twitter.status_activity(25938088801)
def status_activity(id, options={})
response = get("/i/statuses/#{id}/activity/summary.json", options)
response[:body].merge!(:id => id) if response[:body]
Twitter::Tweet.from_response(response)
end
alias tweet_activity status_activity

# Returns activity summary for Tweets
#
# @note Undocumented
# @rate_limited Yes
# @authentication Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Array<Twitter::Tweet>] The requested Tweets.
# @overload statuses_activity(*ids)
# @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs.
# @example Return activity summary for the Tweet with the ID 25938088801
# Twitter.statuses_activity(25938088801)
# @overload statuses_activity(*ids, options)
# @param ids [Array<Integer>, Set<Integer>] An array of Tweet IDs.
# @param options [Hash] A customizable set of options.
def statuses_activity(*args)
arguments = Twitter::API::Arguments.new(args)
arguments.flatten.threaded_map do |id|
status_activity(id, arguments.options)
end
end

# Returns Tweets count for a URL
#
# @note Undocumented
Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/activity_summary.json

This file was deleted.

33 changes: 1 addition & 32 deletions spec/twitter/api/undocumented_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,38 +80,7 @@
end
end

describe "#status_activity" do
before do
stub_get("/i/statuses/25938088801/activity/summary.json").to_return(:body => fixture("activity_summary.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.status_activity(25938088801)
expect(a_get("/i/statuses/25938088801/activity/summary.json")).to have_been_made
end
it "returns a Tweet" do
tweet = @client.status_activity(25938088801)
expect(tweet).to be_a Twitter::Tweet
expect(tweet.retweeters_count).to eq 1
end
end

describe "#statuses_activity" do
before do
stub_get("/i/statuses/25938088801/activity/summary.json").to_return(:body => fixture("activity_summary.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
it "requests the correct resource" do
@client.statuses_activity(25938088801)
expect(a_get("/i/statuses/25938088801/activity/summary.json")).to have_been_made
end
it "returns an array of Tweets" do
tweets = @client.statuses_activity(25938088801)
expect(tweets).to be_an Array
expect(tweets.first).to be_a Twitter::Tweet
expect(tweets.first.retweeters_count).to eq 1
end
end

describe "#statuses_activity" do
describe "#tweet_count" do
before do
stub_request(:get, "https://cdn.api.twitter.com/1/urls/count.json").with(:query => {:url => "http://twitter.com"}).to_return(:body => fixture("count.json"), :headers => {:content_type => "application/json; charset=utf-8"})
end
Expand Down

0 comments on commit 7f97081

Please sign in to comment.