获取谷歌地图搜索位置审查和信息 [英] getting google map searched location review and information
问题描述
我想知道是否有任何方法可以从Google地图信息中提取地点/商店/商店/建筑的评论和信息,请检查以下网址。
i am wondering if there is any way we can pull the reviews and information of a location/store/shop/building from google map info, check following url please.
http://maps.google.com/maps?cid=16753855001018446220 < br>
http://maps.google.com/places/us/california/san-francisco/24th-st/2884/-la-palma-mexicatessen
推荐答案
您可以非常轻松地获取信息页的网址。与TreeUK最初建议的一样,使用本地搜索API,完成后,您将可以访问 yourSearcher.results
。对于每一个,只需抓住 result.url
(或者 yourSearcher.results [i] .url
更精确)获取信息页面。
You can get the URL of the info page pretty easily. Like TreeUK initially suggested, use the local search API, and upon its completion, you'll have access to yourSearcher.results
. For each one, just grab result.url
(or yourSearcher.results[i].url
to be more precise) to get the info page.
如果您希望直接链接到评论页面,请修改 result.url
有点...
If you want the direct link to the reviews page, modify the result.url
a bit...
var baseUrl = 'http://www.google.com/maps/place?';
var cid = result.url.match(/cid=\d*/gi)[0];
var reviewsUrl = baseUrl + cid + '&view=feature&mcsrc=detailed_reviews';
...然后用reviewsUrl做你想要的。
...then do what you want with reviewsUrl.
如果您需要更多评论,请将 num
(以及可选的开始)参数添加到查询字符串中:
If you want more reviews, add the num
(and optionally the start) parameter to the query string:
var reviewsUrl = baseUrl + cid + '&view=feature&mcsrc=detailed_reviews&num=100&start=0';
所以,你真正需要的是cid。一旦你有了,你可以得到任何其他信息。
So, really all you need is the cid. Once you have that, you can get at any of the other info.
这篇关于获取谷歌地图搜索位置审查和信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!