Skip to content
Browse files

Added geographies/{id}/media/recent endpoint

  • Loading branch information...
1 parent f817a73 commit 453c803d5e5169c6157fdedf70f506af2218e8d5 @shayne shayne committed May 9, 2011
View
1 lib/instagram/client.rb
@@ -11,6 +11,7 @@ class Client < API
include Instagram::Client::Users
include Instagram::Client::Media
include Instagram::Client::Locations
+ include Instagram::Client::Geographies
include Instagram::Client::Tags
include Instagram::Client::Comments
include Instagram::Client::Likes
View
29 lib/instagram/client/geographies.rb
@@ -0,0 +1,29 @@
+module Instagram
+ class Client
+ # Defines methods related to real-time geographies
+ module Geographies
+ # Returns a list of recent media items for a given real-time geography
+ #
+ # @overload geography_recent_media(id, options={})
+ # @param user [Integer] A geography ID from a real-time subscription.
+ # @param options [Hash] A customizable set of options.
+ # @option options [Integer] :count (nil) Limit the number of results returned
+ # @option options [Integer] :min_id (nil) Return media before this min_id
+ # @option options [Integer] :max_id (nil) Return media after this max_id
+ # @option options [Integer] :min_timestamp (nil) Return media after this UNIX timestamp
+ # @option options [Integer] :max_timestamp (nil) Return media before this UNIX timestamp
+ # @return [Hashie::Mash]
+ # @example Return a list of the most recent media items taken within a specific geography
+ # Instagram.geography_recent_media(514276)
+ # @see http://instagram.com/developer/endpoints/geographies/
+ # @format :json
+ # @authenticated false
+ # @rate_limited true
+ def geography_recent_media(id, *args)
+ options = args.last.is_a?(Hash) ? args.pop : {}
+ response = get("geographies/#{id}/media/recent", options)
+ response["data"]
+ end
+ end
+ end
+end
View
1 spec/fixtures/geography_recent_media.json
@@ -0,0 +1 @@
+{"pagination": {"next_url": "http://api_privatebeta.instagr.am/api/v2/tags/cat/media/recent/?access_token=f59def8.001cde77128843169627c0308237bafa&max_id=13289272", "next_max_id": 13289272}, "meta": {"code": 200}, "data": [{"type": "image", "comments": [{"created_time": "2010-12-18T02:34:05+0000", "message": "Our new cat with Christian and his grandma. ", "from": {"username": "amandavan", "id": "443107"}, "id": "10124500"}, {"created_time": "2010-12-18T02:37:16+0000", "message": "Gorgeous shot. Loving each others company!", "from": {"username": "ajinnz", "id": "520533"}, "id": "10125060"}, {"created_time": "2010-12-18T03:16:05+0000", "message": "We rescued the cat from a shelter. It only had a few more days left to find a home. He is an adult cat that is very friendly.", "from": {"username": "amandavan", "id": "443107"}, "id": "10131737"}, {"created_time": "2010-12-18T03:23:16+0000", "message": "Sweet:)", "from": {"username": "attosa", "id": "499019"}, "id": "10133068"}, {"created_time": "2010-12-18T03:29:20+0000", "message": "素敵な時間!", "from": {"username": "naot", "id": "119160"}, "id": "10134162"}, {"created_time": "2010-12-18T03:31:14+0000", "message": "Sweet♥", "from": {"username": "paddington", "id": "297689"}, "id": "10134507"}, {"created_time": "2010-12-18T03:33:22+0000", "message": "Beautiful", "from": {"username": "blueclue", "id": "199292"}, "id": "10134879"}, {"created_time": "2010-12-18T04:05:29+0000", "message": "Made popular :) Congrats!", "from": {"username": "brevynsmommy", "id": "919940"}, "id": "10140543"}, {"created_time": "2010-12-18T04:20:58+0000", "message": "(=´∀`)人(´∀`=)", "from": {"username": "mayugonz", "id": "660351"}, "id": "10143131"}, {"created_time": "2010-12-18T04:37:39+0000", "message": "so sweet", "from": {"username": "chaolee", "id": "458637"}, "id": "10145908"}, {"created_time": "2010-12-18T05:43:19+0000", "message": "nice capture!", "from": {"username": "manorr", "id": "352000"}, "id": "10157195"}, {"created_time": "2010-12-18T07:33:43+0000", "message": "Lovely shot.", "from": {"username": "kidtechnical", "id": "981990"}, "id": "10175334"}, {"created_time": "2010-12-18T11:53:04+0000", "message": "So beauty-ful!", "from": {"username": "rss420", "id": "350879"}, "id": "10219843"}, {"created_time": "2010-12-19T03:44:45+0000", "message": "d(^_^o)", "from": {"username": "dhodhadhi", "id": "142482"}, "id": "10384408"}, {"created_time": "2010-12-19T22:09:12+0000", "message": "Aaaaww", "from": {"username": "brianng", "id": "10102"}, "id": "10595111"}, {"created_time": "2010-12-20T02:32:51+0000", "message": "Precious!", "from": {"username": "natalyj08", "id": "462833"}, "id": "10645980"}, {"created_time": "2010-12-20T07:56:15+0000", "message": "Luv it", "from": {"username": "indoazz", "id": "842666"}, "id": "10697595"}, {"created_time": "2010-12-23T07:33:46+0000", "message": "Lovely shot", "from": {"username": "gershwin", "id": "312872"}, "id": "11452636"}, {"created_time": "2011-02-02T01:20:05+0000", "message": "#love #cat", "from": {"username": "amandavan", "id": "443107"}, "id": "26229449"}], "caption": {"created_time": "2010-12-18T02:34:05+0000", "message": "Our new cat with Christian and his grandma. ", "from": {"username": "amandavan", "id": "443107"}, "id": "10124500"}, "like_count": 90, "link": "http://api_privatebeta.instagr.am/p/mQHc/", "user": {"username": "amandavan", "full_name": "", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_443107_75sq_1288981444.jpg", "id": "443107"}, "created_time": "2010-12-18T02:33:22+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/17/08752d7e680a44abb36495f8cf3f09f1_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/17/08752d7e680a44abb36495f8cf3f09f1_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/17/08752d7e680a44abb36495f8cf3f09f1_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "10027484", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T01:19:26+0000", "message": "お傾げ#cat", "from": {"username": "tenkao", "id": "114517"}, "id": "26229234"}], "caption": {"created_time": "2011-02-02T01:19:26+0000", "message": "お傾げ#cat", "from": {"username": "tenkao", "id": "114517"}, "id": "26229234"}, "like_count": 0, "link": "http://api_privatebeta.instagr.am/p/BVpbC/", "user": {"username": "tenkao", "full_name": "Tsutomu Hagiwara", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_114517_75sq_1287300118.jpg", "id": "114517"}, "created_time": "2011-02-02T01:18:39+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/67babf0994bd41f48717455a1ed645bf_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/67babf0994bd41f48717455a1ed645bf_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/67babf0994bd41f48717455a1ed645bf_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "22451906", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T01:09:46+0000", "message": "Even cats blink in pictures. ", "from": {"username": "dmarkey", "id": "496759"}, "id": "26226075"}, {"created_time": "2011-02-02T01:16:40+0000", "message": "#cat", "from": {"username": "dmarkey", "id": "496759"}, "id": "26228267"}], "caption": {"created_time": "2011-02-02T01:09:46+0000", "message": "Even cats blink in pictures. ", "from": {"username": "dmarkey", "id": "496759"}, "id": "26226075"}, "like_count": 0, "link": "http://api_privatebeta.instagr.am/p/BVo8g/", "user": {"username": "dmarkey", "full_name": "Drew Markey", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_496759_75sq_1296534082.jpg", "id": "496759"}, "created_time": "2011-02-02T01:09:10+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/540c61429dba4ef198e99d91e0cefcca_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/540c61429dba4ef198e99d91e0cefcca_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/540c61429dba4ef198e99d91e0cefcca_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "22449952", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T01:15:56+0000", "message": "Ursula the black. #dslr #nofilter", "from": {"username": "ciams", "id": "339307"}, "id": "26228009"}, {"created_time": "2011-02-02T01:16:21+0000", "message": "And #cat. ", "from": {"username": "ciams", "id": "339307"}, "id": "26228151"}], "caption": {"created_time": "2011-02-02T01:15:56+0000", "message": "Ursula the black. #dslr #nofilter", "from": {"username": "ciams", "id": "339307"}, "id": "26228009"}, "like_count": 0, "link": "http://api_privatebeta.instagr.am/p/BVpQR/", "user": {"username": "ciams", "full_name": "Ciam", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_339307_75sq_1295055035.jpg", "id": "339307"}, "created_time": "2011-02-02T01:15:26+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/583d4598747f4d44949dfb9a7bb66c34_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/583d4598747f4d44949dfb9a7bb66c34_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/583d4598747f4d44949dfb9a7bb66c34_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "22451217", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T01:15:06+0000", "message": "ガラス越しのあなた #cat", "from": {"username": "sorateto", "id": "1407213"}, "id": "26227746"}], "caption": {"created_time": "2011-02-02T01:15:06+0000", "message": "ガラス越しのあなた #cat", "from": {"username": "sorateto", "id": "1407213"}, "id": "26227746"}, "like_count": 0, "link": "http://api_privatebeta.instagr.am/p/BVpNO/", "user": {"username": "sorateto", "full_name": "", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1407213_75sq_1295171266.jpg", "id": "1407213"}, "created_time": "2011-02-02T01:14:26+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/02b1810dfd744e1186e9d1c4c48d2e79_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/02b1810dfd744e1186e9d1c4c48d2e79_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/02b1810dfd744e1186e9d1c4c48d2e79_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "22451022", "location": null}, {"type": "image", "comments": [{"created_time": "2011-01-27T17:48:00+0000", "message": "Midnight", "from": {"username": "samnands", "id": "1572362"}, "id": "23619719"}, {"created_time": "2011-02-02T01:03:12+0000", "message": "#midnight #cat #kitty #pet #animal #eyes", "from": {"username": "samnands", "id": "1572362"}, "id": "26223766"}], "caption": {"created_time": "2011-01-27T17:48:00+0000", "message": "Midnight", "from": {"username": "samnands", "id": "1572362"}, "id": "23619719"}, "like_count": 3, "link": "http://api_privatebeta.instagr.am/p/BPG_g/", "user": {"username": "samnands", "full_name": "Sam Fernandes", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1572362_75sq_1296598905.jpg", "id": "1572362"}, "created_time": "2011-01-27T17:47:58+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/27/d7056b7a0b094eb1bf8bcd27dcebef00_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/27/d7056b7a0b094eb1bf8bcd27dcebef00_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/27/d7056b7a0b094eb1bf8bcd27dcebef00_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "20738016", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T01:00:08+0000", "message": "#sleep #cat", "from": {"username": "super_mimi_", "id": "1721424"}, "id": "26222773"}], "caption": null, "like_count": 1, "link": "http://api_privatebeta.instagr.am/p/BR_R3/", "user": {"username": "super_mimi_", "full_name": "Mimi ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1721424_75sq_1296492509.jpg", "id": "1721424"}, "created_time": "2011-01-30T00:16:02+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/29/bf7b4dd6aacd48be8ae74076c80d8752_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/29/bf7b4dd6aacd48be8ae74076c80d8752_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/29/bf7b4dd6aacd48be8ae74076c80d8752_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "21492855", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-29T02:52:01+0000", "message": "Beautiful lil friend!!", "from": {"username": "tashiko", "id": "889932"}, "id": "13086996"}, {"created_time": "2010-12-29T03:47:38+0000", "message": "I'm not a fan of cats, still like this shot a lot.", "from": {"username": "cryingjune", "id": "678148"}, "id": "13099247"}, {"created_time": "2010-12-29T10:15:32+0000", "message": "@cryingjune awww thanks heaps! ", "from": {"username": "tashiko", "id": "889932"}, "id": "13175014"}, {"created_time": "2011-02-02T00:43:33+0000", "message": "#Tashiko #cat #light #eye", "from": {"username": "tashiko", "id": "889932"}, "id": "26217211"}], "caption": {"created_time": "2010-12-29T02:52:01+0000", "message": "Beautiful lil friend!!", "from": {"username": "tashiko", "id": "889932"}, "id": "13086996"}, "like_count": 4, "link": "http://api_privatebeta.instagr.am/p/wUN_/", "user": {"username": "tashiko", "full_name": "", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_889932_75sq_1291277200.jpg", "id": "889932"}, "created_time": "2010-12-29T02:51:53+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/28/b8ff036f071c4ac4b8a66bea459eebf6_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/28/b8ff036f071c4ac4b8a66bea459eebf6_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/28/b8ff036f071c4ac4b8a66bea459eebf6_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "12665727", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T00:43:07+0000", "message": "#cat 's #eyes , #cateyes", "from": {"username": "camilletwentyseven", "id": "983122"}, "id": "26217085"}, {"created_time": "2011-02-02T01:19:29+0000", "message": "The Cats Eye! ;)", "from": {"username": "andy_warhol", "id": "1540858"}, "id": "26229252"}], "caption": {"created_time": "2011-02-02T00:43:07+0000", "message": "#cat 's #eyes , #cateyes", "from": {"username": "camilletwentyseven", "id": "983122"}, "id": "26217085"}, "like_count": 5, "link": "http://api_privatebeta.instagr.am/p/BVnlX/", "user": {"username": "camilletwentyseven", "full_name": "Camille ~ ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_983122_75sq_1296348573.jpg", "id": "983122"}, "created_time": "2011-02-02T00:42:50+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/1d7e99a9ae5145aabd68ffdeaa771698_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/1d7e99a9ae5145aabd68ffdeaa771698_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/1d7e99a9ae5145aabd68ffdeaa771698_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "22444375", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-29T02:55:11+0000", "message": "", "from": {"username": "tashiko", "id": "889932"}, "id": "13087621"}, {"created_time": "2011-01-04T02:42:26+0000", "message": "So lovely!", "from": {"username": "taki17", "id": "411305"}, "id": "14977647"}, {"created_time": "2011-01-04T02:53:39+0000", "message": "@taki17 - I thought u might like these kitties!! ", "from": {"username": "tashiko", "id": "889932"}, "id": "14980241"}, {"created_time": "2011-01-04T03:06:08+0000", "message": "Ya I love it so much!", "from": {"username": "taki17", "id": "411305"}, "id": "14983160"}, {"created_time": "2011-02-02T00:42:18+0000", "message": "#Tashiko #cat #kitten", "from": {"username": "tashiko", "id": "889932"}, "id": "26216824"}], "caption": {"created_time": "2010-12-29T02:55:11+0000", "message": "", "from": {"username": "tashiko", "id": "889932"}, "id": "13087621"}, "like_count": 2, "link": "http://api_privatebeta.instagr.am/p/wUWU/", "user": {"username": "tashiko", "full_name": "", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_889932_75sq_1291277200.jpg", "id": "889932"}, "created_time": "2010-12-29T02:55:09+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/28/be01cefa28ee41b0beda68d4c249d514_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/28/be01cefa28ee41b0beda68d4c249d514_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/28/be01cefa28ee41b0beda68d4c249d514_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "12666260", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T00:33:51+0000", "message": "おはようございます(^_^)優雅なお目覚め、メイさんです♡", "from": {"username": "ayachimaru", "id": "1568922"}, "id": "26214037"}, {"created_time": "2011-02-02T00:34:16+0000", "message": "#cat", "from": {"username": "ayachimaru", "id": "1568922"}, "id": "26214171"}, {"created_time": "2011-02-02T00:39:32+0000", "message": "おはようございます( ´ ▽ ` )ノ 美人さんですね", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26215878"}], "caption": {"created_time": "2011-02-02T00:33:51+0000", "message": "おはようございます(^_^)優雅なお目覚め、メイさんです♡", "from": {"username": "ayachimaru", "id": "1568922"}, "id": "26214037"}, "like_count": 1, "link": "http://api_privatebeta.instagr.am/p/BVnHI/", "user": {"username": "ayachimaru", "full_name": "", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1568922_75sq_1296342395.jpg", "id": "1568922"}, "created_time": "2011-02-02T00:33:10+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/8391c99328b04265b231065033dda4c7_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/8391c99328b04265b231065033dda4c7_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/02/01/8391c99328b04265b231065033dda4c7_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "22442440", "location": null}, {"type": "image", "comments": [{"created_time": "2011-01-20T12:00:25+0000", "message": "にゃーこも黄昏るんだよ。なら、わしら人間も黄昏れようよ。そんな急かせかしないでさ。", "from": {"username": "break08mia", "id": "212679"}, "id": "20755823"}, {"created_time": "2011-01-20T12:12:26+0000", "message": "のんびりニャー", "from": {"username": "inahoo", "id": "845707"}, "id": "20759132"}, {"created_time": "2011-01-20T12:15:36+0000", "message": "ほんとだ! 自分の時間って必要だよね。", "from": {"username": "genzo", "id": "231388"}, "id": "20760033"}, {"created_time": "2011-01-20T12:27:26+0000", "message": "今まさに黄昏てるよ。( ̄。 ̄*)ボ----------", "from": {"username": "kame_chi", "id": "144925"}, "id": "20763443"}, {"created_time": "2011-01-20T12:34:40+0000", "message": "( ´ ▽ ` )ノ", "from": {"username": "cfumi_loveyou", "id": "787830"}, "id": "20765579"}, {"created_time": "2011-01-20T12:49:43+0000", "message": "+。:.゚(* ゚A ゚*):.。+゚ぽけー", "from": {"username": "kikuji", "id": "141620"}, "id": "20769901"}, {"created_time": "2011-01-20T13:05:31+0000", "message": "うんうん♥ゆっくりまったりね。", "from": {"username": "aoi3179", "id": "589625"}, "id": "20774611"}, {"created_time": "2011-01-20T14:32:11+0000", "message": "いい構図!黄昏てますね〜♬こんな時間って大事だよなぁ〜", "from": {"username": "ebapi", "id": "257364"}, "id": "20801658"}, {"created_time": "2011-01-20T15:21:21+0000", "message": "コンスタントに黄昏ます(。-_-。)", "from": {"username": "dai_suke", "id": "124496"}, "id": "20817536"}, {"created_time": "2011-01-20T15:50:03+0000", "message": "Kawaiiii ", "from": {"username": "yuriko211", "id": "182316"}, "id": "20826471"}, {"created_time": "2011-01-20T15:52:18+0000", "message": "いいね。その感じ♪( ´▽`)そうでありたいな~♪", "from": {"username": "eri1982", "id": "748613"}, "id": "20827141"}, {"created_time": "2011-01-20T16:17:44+0000", "message": "ごもっとも(笑)", "from": {"username": "jyonzo", "id": "167443"}, "id": "20834724"}, {"created_time": "2011-01-20T17:32:05+0000", "message": "♪(´ε` )", "from": {"username": "1100211", "id": "211271"}, "id": "20854833"}, {"created_time": "2011-01-21T10:17:30+0000", "message": "@inahoo だにゃあー♥花金だあー♥", "from": {"username": "break08mia", "id": "212679"}, "id": "21105445"}, {"created_time": "2011-01-21T10:18:03+0000", "message": "@genzo 時間を上手く使える人は大人だなあと思います!", "from": {"username": "break08mia", "id": "212679"}, "id": "21105569"}, {"created_time": "2011-01-21T10:18:33+0000", "message": "@kame_chi いいなw 私はこれから♥ひひひっ♥", "from": {"username": "break08mia", "id": "212679"}, "id": "21105678"}, {"created_time": "2011-01-21T10:18:59+0000", "message": "@cfumi_loveyou いいでしょ?(o^^o)", "from": {"username": "break08mia", "id": "212679"}, "id": "21105783"}, {"created_time": "2011-01-21T10:19:17+0000", "message": "@kikuji 君もかいw", "from": {"username": "break08mia", "id": "212679"}, "id": "21105851"}, {"created_time": "2011-01-21T10:20:10+0000", "message": "@aoi3179 私の人生の大半はゆっくりまったりwそれでもなお、にゃーこが羨ましい♥", "from": {"username": "break08mia", "id": "212679"}, "id": "21106040"}, {"created_time": "2011-01-21T10:21:19+0000", "message": "@ebapi そう見えますよね♥私も猫になったつもりで、本日のんびりさせていただきますw", "from": {"username": "break08mia", "id": "212679"}, "id": "21106290"}, {"created_time": "2011-01-21T10:21:55+0000", "message": "@dai_suke それ人生において、非常に大切なポイントだと思う!", "from": {"username": "break08mia", "id": "212679"}, "id": "21106439"}, {"created_time": "2011-01-21T10:22:38+0000", "message": "@yuriko211 にゃーこはいつも可愛くて羨ましいですね(´Д` )♥", "from": {"username": "break08mia", "id": "212679"}, "id": "21106597"}, {"created_time": "2011-01-21T10:23:56+0000", "message": "@eri1982 なかなか黄昏れる余裕ないもんねー。生きづらいわっw今度一緒に黄昏ようー♥", "from": {"username": "break08mia", "id": "212679"}, "id": "21106905"}, {"created_time": "2011-01-21T10:24:44+0000", "message": "@jyonzo そう思ってもらえて我輩うれしいにゃー♥", "from": {"username": "break08mia", "id": "212679"}, "id": "21107072"}, {"created_time": "2011-01-21T10:25:16+0000", "message": "@110211( *`ω´) ノ", "from": {"username": "break08mia", "id": "212679"}, "id": "21107188"}, {"created_time": "2011-01-23T01:38:33+0000", "message": "にゃーこと日向ぼっこもしたいにゃー(「ΦωΦ)♡", "from": {"username": "sakisugita", "id": "74513"}, "id": "21788864"}, {"created_time": "2011-01-23T03:12:49+0000", "message": "いい写真だな〜(^^)", "from": {"username": "respetar", "id": "237709"}, "id": "21818611"}, {"created_time": "2011-02-02T00:25:37+0000", "message": "#break08mia #cat", "from": {"username": "break08mia", "id": "212679"}, "id": "26211338"}], "caption": {"created_time": "2011-01-20T12:00:25+0000", "message": "にゃーこも黄昏るんだよ。なら、わしら人間も黄昏れようよ。そんな急かせかしないでさ。", "from": {"username": "break08mia", "id": "212679"}, "id": "20755823"}, "like_count": 77, "link": "http://api_privatebeta.instagr.am/p/BG82f/", "user": {"username": "break08mia", "full_name": "Tw:@ Mikan0range", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_212679_75sq_1288622923.jpg", "id": "212679"}, "created_time": "2011-01-20T11:58:58+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/20/e6fe0fb1ef944183a33f7862ef91cff1_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/20/e6fe0fb1ef944183a33f7862ef91cff1_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2011/01/20/e6fe0fb1ef944183a33f7862ef91cff1_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "18599327", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-19T13:43:36+0000", "message": "足が痺れた ㅠㅠ", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "10500494"}, {"created_time": "2010-12-25T22:53:07+0000", "message": "この眼差しがいいですね☆(^^)", "from": {"username": "mayugonz", "id": "660351"}, "id": "12212162"}, {"created_time": "2011-02-02T00:25:21+0000", "message": "#orangetabby #orangecat #cat\n#kanchan", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26211246"}], "caption": {"created_time": "2010-12-19T13:43:36+0000", "message": "足が痺れた ㅠㅠ", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "10500494"}, "like_count": 6, "link": "http://api_privatebeta.instagr.am/p/nklf/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-19T13:43:14+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/19/14620267e61e4fba8a49401f1257e7f3_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/19/14620267e61e4fba8a49401f1257e7f3_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/19/14620267e61e4fba8a49401f1257e7f3_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "10373471", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-26T06:21:07+0000", "message": "今日も なかよし", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "12300004"}, {"created_time": "2010-12-26T12:06:39+0000", "message": "いい子だねー♥(^▿^。)", "from": {"username": "2120sma", "id": "196066"}, "id": "12359152"}, {"created_time": "2011-02-02T00:24:43+0000", "message": "#orangetabby #orangecat #cat\n#kanchan #taejakun", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26211020"}], "caption": {"created_time": "2010-12-26T06:21:07+0000", "message": "今日も なかよし", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "12300004"}, "like_count": 7, "link": "http://api_privatebeta.instagr.am/p/toJt/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-26T06:20:51+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/64c1d4b0f8d64ef1a19903b56bef9b6a_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/64c1d4b0f8d64ef1a19903b56bef9b6a_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/64c1d4b0f8d64ef1a19903b56bef9b6a_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "11960941", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-26T06:24:00+0000", "message": "寒いねぇ 眠いねぇ", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "12300470"}, {"created_time": "2011-02-02T00:24:32+0000", "message": "#orangetabby #orangecat #cat\n#kanchan #taejakun", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210962"}], "caption": {"created_time": "2010-12-26T06:24:00+0000", "message": "寒いねぇ 眠いねぇ", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "12300470"}, "like_count": 6, "link": "http://api_privatebeta.instagr.am/p/toRk/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-26T06:23:33+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/191f3b2c7aeb446da7e01d4c813ea849_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/191f3b2c7aeb446da7e01d4c813ea849_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/191f3b2c7aeb446da7e01d4c813ea849_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "11961444", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-26T06:34:09+0000", "message": "むにゃむにゃ", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "12302175"}, {"created_time": "2011-02-02T00:24:20+0000", "message": "#orangetabby #orangecat #cat\n#kanchan #taejakun", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210893"}], "caption": {"created_time": "2010-12-26T06:34:09+0000", "message": "むにゃむにゃ", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "12302175"}, "like_count": 6, "link": "http://api_privatebeta.instagr.am/p/tove/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-26T06:34:07+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/8357d3db223e460ebe6c82f5c7f22083_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/8357d3db223e460ebe6c82f5c7f22083_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/25/8357d3db223e460ebe6c82f5c7f22083_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "11963358", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T00:24:08+0000", "message": "#orangetabby #orangecat #cat\n#kanchan", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210825"}], "caption": null, "like_count": 5, "link": "http://api_privatebeta.instagr.am/p/xSRh/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-30T03:21:55+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/f2be14b699904f359585098035afda2a_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/f2be14b699904f359585098035afda2a_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/f2be14b699904f359585098035afda2a_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "12919905", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-30T03:22:46+0000", "message": "大掃除が終わりません", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "13389363"}, {"created_time": "2011-02-02T00:23:54+0000", "message": "#orangetabby #orangecat #cat\n#kanchan", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210739"}], "caption": {"created_time": "2010-12-30T03:22:46+0000", "message": "大掃除が終わりません", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "13389363"}, "like_count": 7, "link": "http://api_privatebeta.instagr.am/p/xSTH/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-30T03:22:25+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/7ba3e40263444617a22510a1440e4768_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/7ba3e40263444617a22510a1440e4768_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/7ba3e40263444617a22510a1440e4768_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "12920007", "location": null}, {"type": "image", "comments": [{"created_time": "2010-12-30T03:34:23+0000", "message": "幸せそうv", "from": {"username": "usyako", "id": "300667"}, "id": "13391776"}, {"created_time": "2011-02-02T00:23:39+0000", "message": "#orangetabby #orangecat #cat\n#kanchan", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210658"}], "caption": null, "like_count": 6, "link": "http://api_privatebeta.instagr.am/p/xSZe/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-30T03:24:41+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/330ddc6c02504318ab5097ae2b3c0788_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/330ddc6c02504318ab5097ae2b3c0788_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/29/330ddc6c02504318ab5097ae2b3c0788_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "12920414", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T00:23:25+0000", "message": "#orangetabby #orangecat #cat\n#kanchan #taejakun", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210570"}], "caption": null, "like_count": 2, "link": "http://api_privatebeta.instagr.am/p/ysb4/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-31T12:22:46+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/31/4dd358aba2eb419b9bee64204af2e159_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/31/4dd358aba2eb419b9bee64204af2e159_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/31/4dd358aba2eb419b9bee64204af2e159_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "13289208", "location": null}, {"type": "image", "comments": [{"created_time": "2011-02-02T00:23:15+0000", "message": "#orangetabby #orangecat #cat\n#kanchan #taejakun", "from": {"username": "miyabiyaka", "id": "681498"}, "id": "26210504"}], "caption": null, "like_count": 5, "link": "http://api_privatebeta.instagr.am/p/ysc4/", "user": {"username": "miyabiyaka", "full_name": " Yuuka ", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_681498_75sq_1295987698.jpg", "id": "681498"}, "created_time": "2010-12-31T12:23:01+0000", "images": {"low_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/31/2726981bc6f5471ca680447980e64bdc_6.jpg", "width": 480, "height": 480}, "thumbnail": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/31/2726981bc6f5471ca680447980e64bdc_5.jpg", "width": 150, "height": 150}, "high_resolution": {"url": "http://distillery.s3.amazonaws.com/media/2010/12/31/2726981bc6f5471ca680447980e64bdc_7.jpg", "width": 612, "height": 612}}, "user_has_liked": false, "id": "13289272", "location": null}]}
View
37 spec/instagram/client/geography_spec.rb
@@ -0,0 +1,37 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe Instagram::Client do
+ Instagram::Configuration::VALID_FORMATS.each do |format|
+ context ".new(:format => '#{format}')" do
+ before do
+ @client = Instagram::Client.new(:format => format, :client_id => 'CID', :client_secret => 'CS', :access_token => 'AT')
+ end
+
+
+ describe ".geography_recent_media" do
+
+ context "with geography ID passed" do
+
+ before do
+ stub_get("geographies/12345/media/recent.#{format}").
+ with(:query => {:access_token => @client.access_token}).
+ to_return(:body => fixture("geography_recent_media.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
+ end
+
+ it "should get the correct resource" do
+ @client.geography_recent_media(12345)
+ a_get("geographies/12345/media/recent.#{format}").
+ with(:query => {:access_token => @client.access_token}).
+ should have_been_made
+ end
+
+ it "should return a list of recent media items within the specifed geography" do
+ recent_media = @client.geography_recent_media(12345)
+ recent_media.should be_a Array
+ recent_media.first.user.username.should == "amandavan"
+ end
+ end
+ end
+ end
+ end
+end

0 comments on commit 453c803

Please sign in to comment.
Something went wrong with that request. Please try again.