Skip to content
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
6 changes: 5 additions & 1 deletion lib/class.instagram.media.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class InstagramMedia

info: (params) ->
credentials = @parent._credentials {}
params['path'] = "/#{@parent._api_version}/media/#{params['media_id']}?#{@parent._to_querystring(credentials)}"
if params['media_shortcode']
path = "/media/shortcode/#{params['media_shortcode']}"
else
path = "/media/#{params['media_id']}"
params['path'] = "/#{@parent._api_version}#{path}?#{@parent._to_querystring(credentials)}"
@parent._request params

search: (params) ->
Expand Down
36 changes: 20 additions & 16 deletions lib/class.instagram.media.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"directories": {
"lib": "./lib"
},
"devDependencies": {
"express": "3.17.7",
"expresso": "*",
"should": "*"
},
"files": [
""
],
Expand Down
7 changes: 7 additions & 0 deletions test/instagram.media.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ module.exports =
data.should.have.property 'created_time', '1279315783'
test.output "data had the property 'created_time' equal to 1279315783"
app.finish_test()
'media#info for shortcode#33': ->
test.helper 'media#info for shortcode#33', Instagram, 'media', 'info', { media_shortcode: 33 }, (data) ->
data.should.have.property 'shortcode', '33'
test.output "data had the property 'shortcode' equal to 33"
data.should.have.property 'created_time', '1279315783'
test.output "data had the property 'created_time' equal to 1279315783"
app.finish_test()
'media#search for 48.858844300000001/2.2943506': ->
test.helper 'media#search for 48.858844300000001/2.2943506', Instagram, 'media', 'search', { lat: 48.858844300000001, lng: 2.2943506 }, (data) ->
data.length.should.be.above 0
Expand Down
24 changes: 17 additions & 7 deletions test/instagram.media.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.