Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed method because of retired endpoint #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions lib/instagram/client/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@ def media_item(*args)
response
end

# Returns extended information of a given media item
#
# @overload media_shortcode(shortcode)
# @param shortcode [String] An Instagram media item shortcode
# @return [Hashie::Mash] The requested media item.
# @example Return extended information for media item with shortcode 'D'
# Instagram.media_shortcode('D')
# @format none
# @authenticated false unless requesting media from a protected user
#
# If getting this data of a protected user, you must authenticate (and be allowed to see that user).
# @rate_limited true
# @see http://instagram.com/developer/endpoints/media/#get_media_by_shortcode
def media_shortcode(*args)
shortcode = args.first
response = get("media/shortcode/#{shortcode}", {}, false, false, true)
response
end

# Returns a list of the overall most popular media
#
# @overload media_popular(options={})
Expand Down
20 changes: 0 additions & 20 deletions spec/instagram/client/media_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,6 @@
end
end

describe ".media_shortcode" do
before do
stub_get("media/shortcode/BG9It")
.with(query: { access_token: @client.access_token })
.to_return(body: fixture("media_shortcode.#{format}"), headers: { content_type: "application/#{format}; charset=utf-8" })
end

it "should get the correct resource" do
@client.media_shortcode("BG9It")
expect(a_get("media/shortcode/BG9It")
.with(query: { access_token: @client.access_token }))
.to have_been_made
end

it "should return extended information of a given media item" do
media = @client.media_shortcode("BG9It")
expect(media.user.username).to eq("mikeyk")
end
end

describe ".media_popular" do
before do
stub_get("media/popular.#{format}")
Expand Down