从四方API获取图片(Getting picture from foursquare API)

编程入门 行业动态 更新时间:2024-10-25 12:17:20
从四方API获取图片(Getting picture from foursquare API)

来自foursquare API的新更新指示要组装可解析的照片网址,采用前缀+大小+后缀,例如

https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.

在这里,我得到的响应地点示例但我的链接并置不起作用。 我该如何解决这个问题? https://ss3.4​​sqi.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 },

The new update on from the foursquare API indicates to assemble a resolvable photo URL, take prefix + size + suffix, e.g.

https://irs0.4sqi.net/img/general/300x500/2341723_vt1Kr-SfmRmdge-M7b4KNgX2_PHElyVbYL65pMnxEQw.jpg.

Here a sample of the response venue that I m getting but my link concatenation isn't working. How can i fix this issue ? 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。

REF。 https://developer.foursquare.com/docs/responses/category.html

例如https://ss3.4​​sqi.net/img/categories_v2/shops/conveniencestore_32.png

In case of category icon, 32, 44, 64, and 88 are available.

ref. https://developer.foursquare.com/docs/responses/category.html

e.g. https://ss3.4sqi.net/img/categories_v2/shops/conveniencestore_32.png

更多推荐

本文发布于:2023-07-24 00:28:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239301.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图片   API   foursquare   picture

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!