从 foursquare 获取图片 API
Getting picture from foursquare API
foursquare API 的新更新指示 assemble 可解析的照片 URL,取前缀 + 大小 + 后缀,例如
https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.
这里是我得到的响应地点示例,但我的 link 串联不起作用。我该如何解决这个问题?
https://ss3.4sqi.net/img/categories_v2/shops/conveniencestore_100x100.png
"response":{
"venues":[
{
"id":"5274eb0f498efd84c1aa5283",
"name":"Starbucks",
"contact":{
"phone":"3056532071",
"formattedPhone":"(305) 653-2071",
"twitter":"starbucks",
"facebook":"22092443056",
"facebookUsername":"Starbucks",
"facebookName":"Starbucks"
},
"location":{
"address":"199 NE 167th Street",
"crossStreet":"NE 2nd Ave.",
"lat":25.928553,
"lng":-80.19656,
"labeledLatLngs":[
{
"label":"display",
"lat":25.928553,
"lng":-80.19656
}
],
"distance":206,
"postalCode":"33162",
"cc":"US",
"city":"Miami",
"state":"FL",
"country":"United States",
"formattedAddress":[
"199 NE 167th Street (NE 2nd Ave.)",
"Miami, FL 33162",
"United States"
]
},
"categories":[
{
"id":"4bf58dd8d48988d1e0931735",
"name":"Coffee Shop",
"pluralName":"Coffee Shops",
"shortName":"Coffee Shop",
"icon":{
"prefix":"https://ss3.4sqi.net/img/categories_v2/food/coffeeshop_",
"suffix":".png"
},
"primary":true
}
],
"verified":true,
"stats":{
"checkinsCount":614,
"usersCount":196,
"tipCount":7
},
"url":"http://www.starbucks.com",
"allowMenuUrlEdit":true,
"beenHere":{
"lastCheckinExpiredAt":0
},
"specials":{
"count":0,
"items":[
]
},
"storeId":"19899",
"hereNow":{
"count":0,
"summary":"Nobody here",
"groups":[
]
},
"referralId":"v-1486970551",
"venueChains":[
{
"id":"556f676fbd6a75a99038d8ec"
}
],
"hasPerk":false
},
如果是类别图标,则可以使用 32、44、64 和 88。
参考。 https://developer.foursquare.com/docs/responses/category.html
例如https://ss3.4sqi.net/img/categories_v2/shops/conveniencestore_32.png
foursquare API 的新更新指示 assemble 可解析的照片 URL,取前缀 + 大小 + 后缀,例如
https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.
这里是我得到的响应地点示例,但我的 link 串联不起作用。我该如何解决这个问题? https://ss3.4sqi.net/img/categories_v2/shops/conveniencestore_100x100.png
"response":{
"venues":[
{
"id":"5274eb0f498efd84c1aa5283",
"name":"Starbucks",
"contact":{
"phone":"3056532071",
"formattedPhone":"(305) 653-2071",
"twitter":"starbucks",
"facebook":"22092443056",
"facebookUsername":"Starbucks",
"facebookName":"Starbucks"
},
"location":{
"address":"199 NE 167th Street",
"crossStreet":"NE 2nd Ave.",
"lat":25.928553,
"lng":-80.19656,
"labeledLatLngs":[
{
"label":"display",
"lat":25.928553,
"lng":-80.19656
}
],
"distance":206,
"postalCode":"33162",
"cc":"US",
"city":"Miami",
"state":"FL",
"country":"United States",
"formattedAddress":[
"199 NE 167th Street (NE 2nd Ave.)",
"Miami, FL 33162",
"United States"
]
},
"categories":[
{
"id":"4bf58dd8d48988d1e0931735",
"name":"Coffee Shop",
"pluralName":"Coffee Shops",
"shortName":"Coffee Shop",
"icon":{
"prefix":"https://ss3.4sqi.net/img/categories_v2/food/coffeeshop_",
"suffix":".png"
},
"primary":true
}
],
"verified":true,
"stats":{
"checkinsCount":614,
"usersCount":196,
"tipCount":7
},
"url":"http://www.starbucks.com",
"allowMenuUrlEdit":true,
"beenHere":{
"lastCheckinExpiredAt":0
},
"specials":{
"count":0,
"items":[
]
},
"storeId":"19899",
"hereNow":{
"count":0,
"summary":"Nobody here",
"groups":[
]
},
"referralId":"v-1486970551",
"venueChains":[
{
"id":"556f676fbd6a75a99038d8ec"
}
],
"hasPerk":false
},
如果是类别图标,则可以使用 32、44、64 和 88。
参考。 https://developer.foursquare.com/docs/responses/category.html
例如https://ss3.4sqi.net/img/categories_v2/shops/conveniencestore_32.png