http get/post 请求和 google geolocation api

发布于 2024-07-16 09:19:35 字数 671 浏览 7 评论 0原文

我正在 http://m.rummble.com 网站上使用 Web 应用程序,当我单击查找我的使用齿轮定位。 该应用程序返回我当前的位置(大致的城市位置)以及给定英里半径内的各种机构。 为了进一步了解其工作原理,我打开了wireshark,我注意到 POST 请求被发送到 www.google.com/loc/json。 然后谷歌服务器以 JSON 格式响应 200 OK 和位置数据。 我理解这部分。 接下来的步骤是我不明白的。 显然,在 Rumble 应用程序收到位置数据(纬度、经度、地址等)后,它会使用 GET 请求将此信息发送到另一台服务器上的某个 api,该服务器获取给定英里半径内的各种设施。 我所做的就是点击,使用齿轮找到我的位置。 我合理地期望应用程序只返回我的位置,但它返回的内容不止于此,而无需单击应用程序中的任何其他按钮。 有人可以解释这是如何发生的吗? 有没有一个脚本可以实现这一点? 我希望我能更好地解释我的情况。
替代文本 http://img211.imageshack.us/img211/1236/examplel.jpg< /a>

I'm using the web application at http://m.rummble.com website and when I click find my location using gears. The application returns my current location (approximate city location) with various establishments in a given mile radius. To further understand how this works, I opened up wireshark and what I notice is that a POST request is sent to www.google.com/loc/json. Then the google server responds with 200 OK and location data in JSON format. I understand this part. The next step is what I don't understand. Apparently after the rummble application receives the location data (lat, long, address, etc.) it sends this information using a GET request to some api on another server that acquires the various establishments in a given mile radius. All I did was click, find my location using gears. I would reasonably expect the application to just return my location but it's returning more than that without clicking any other buttons in the application. Can someone explain how this happens? Is there a script that makes this happen? I hope I explained my situation better.
alt text http://img211.imageshack.us/img211/1236/examplel.jpg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最终幸福 2024-07-23 09:19:35

确定匿名用户位置的第一步是通过他的 IP。 如果这就是您想要的,您需要执行以下两件事之一:

  1. 查找 IP 和位置数据库。 快速 Google 搜索出现了 http://ip- to-country.webhosting.info/downloads/ip-to-country.csv.zip
  2. 使用 DNS 跟踪路由并反向查找主机名的 IP,并尝试读取主机名以获取地理信息,例如作为国家和城市。

无论哪种方式,一旦您有了一个国家和/或城市,您就可以进行查找地理查找来查找纬度和经度,并根据这些坐标显示地图。

据推测,Google Gears 使用了类似的东西,或者可能基于 Google 使用各种数据收集技术大量收集的数据。 这样,一旦 Google Gears 确定了用户所在的位置,它就知道他所在的城市/国家,并请求匹配的纬度和经度。

Well, the first step in determining an anonymous user's location, is by his IP. If that's what you want, you need to do one of two things:

  1. Find a database of IP-and-locations. A quick Google search turned up http://ip-to-country.webhosting.info/downloads/ip-to-country.csv.zip
  2. Trace route and reverse-lookup the IPs to host names using DNS, and try to read the host names for geo-information, such as country and city.

Either way, once you have a country and/or city, you can do a lookup geo-lookup to find latitude and longitude, and display a map based on those coordinates.

Presumably, Google Gears uses something similar, or perhaps based on data mass-collected by Google using their various data-collection techniques. That way, once Google Gears has figured out where the user is, it knows which city/country he's in, and requests the matching latitude and longitude.

纸短情长 2024-07-23 09:19:35

无论出于何种原因,rummble.com 都没有在我的计算机上查询 navigator.getlocation,因此我无法亲自确认您的报告。

但是,当您单击允许 rummble.com 从 Gears 获取您的位置时,您将该位置信息移交给 rummble.com 网站。 然后,该网站可以随意处理它——信息返回到浏览器上运行的一段 Javascript,在这种情况下,听起来该 Javascript 正在使用您的位置信息来加载附近的列表餐馆。

您可能非常有理由担心这一点。 如果 Rumble 将您的姓名和位置信息发送给广告商或政府怎么办? 他们会存储您的精确位置信息多长时间? 在授予与网站共享您的位置的权限之前,您应该考虑这些影响。

For whatever reason, rummble.com isn't querying navigator.getlocation on my machine, so I can't confirm your report myself.

However, when you click to allow rummble.com to get your location from Gears, you're handing over that location information to the rummble.com website. That website is then free to do with it as it wants -- the information is returned to a piece of Javascript running on the browser, and in this case it sounds like that piece of Javascript is using your location information to load a list of nearby restaurants.

You might very reasonably be worried about this. What if rummble were sending your name and location information to an advertiser or to the government? How long are they storing your precise location information? You should consider these implications before giving permission to share your location with a website.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文