diff --git a/CHANGELOG b/CHANGELOG index fe86906..aa9ddb1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +# v0.1.8 +# get_media method bug fixed # v0.1.7 # get_user method bug fixed @@ -10,4 +12,4 @@ # Some refactoring # v0.1.0 -# Initial commit. \ No newline at end of file +# Initial commit. diff --git a/lib/ruby-instagram-scraper.rb b/lib/ruby-instagram-scraper.rb index 404a2af..70310c6 100644 --- a/lib/ruby-instagram-scraper.rb +++ b/lib/ruby-instagram-scraper.rb @@ -42,7 +42,7 @@ def self.get_media ( code ) url = "#{BASE_URL}/p/#{ code }/?__a=1" params = "" - JSON.parse( open( "#{url}#{params}" ).read )["media"] + JSON.parse( open( "#{url}#{params}" ).read )["graphql"]["shortcode_media"] end def self.get_media_comments ( shortcode, count = 40, before = nil ) @@ -55,4 +55,4 @@ def self.get_media_comments ( shortcode, count = 40, before = nil ) JSON.parse( open( url ).read )["comments"] end -end \ No newline at end of file +end diff --git a/ruby-instagram-scraper.gemspec b/ruby-instagram-scraper.gemspec index 9ec45b3..31a8fc3 100644 --- a/ruby-instagram-scraper.gemspec +++ b/ruby-instagram-scraper.gemspec @@ -2,8 +2,8 @@ # encoding: utf-8 Gem::Specification.new do |s| s.name = 'ruby-instagram-scraper' - s.version = '0.1.7' - s.date = '2016-05-31' + s.version = '0.1.8' + s.date = '2017-12-13' s.summary = "A simple module for requests to Instagram without an API key." s.description = "A simple module for requests to Instagram without an API key." s.authors = [ "Sergey Borodanov" ] @@ -12,4 +12,4 @@ Gem::Specification.new do |s| s.test_files = [ "test/ruby_instagram_scraper_test.rb" ] s.homepage = 'https://github.com/sborod/ruby-instagram-scraper' s.license = 'MIT' -end \ No newline at end of file +end diff --git a/test/ruby_instagram_scraper_test.rb b/test/ruby_instagram_scraper_test.rb index 73e4d60..89ef6d6 100644 --- a/test/ruby_instagram_scraper_test.rb +++ b/test/ruby_instagram_scraper_test.rb @@ -23,7 +23,7 @@ describe "when request a media" do it "must has equal code in field" do - RubyInstagramScraper.get_media( "vKQeMNu7H1" )["code"].must_equal "vKQeMNu7H1" + RubyInstagramScraper.get_media( "vKQeMNu7H1" )["shortcode"].must_equal "vKQeMNu7H1" end end @@ -39,4 +39,4 @@ end end -end \ No newline at end of file +end