为我的网站构建具有一些 foursquare 功能的服务
我有兴趣扩展我的网站以提供一项涉及用户在我的大学校园“签到”的服务。由于基于位置的服务(LBS)是相当新的,并且没有太多文献可以提供与此问题相关的兴趣,因此我有以下问题要问:
首先,我知道我必须设计一个 Android 应用程序,并且可能还需要设计一个电话应用程序。据我猜测,foursquare 只是使用客户端来回发送数据到他们的网络服务器。
- 客户端与网络服务器通信的标准协议是什么? (或者只是 json 或 xml?)
- 他们在后端使用什么样的特殊 Web 服务? (就像一些研究表明他们正在使用用 Scala 编写的 LIFT,这是我不熟悉的东西。)。
- 我很了解Python。是否有网络服务器(即 django 或 pylons)提供与上述 2)类似的服务?
- 这到底有多难?
此外,非常感谢有关此主题的任何文献。
I am interested in extending my website to provide a service which involves users "check in" in my university's campus. Since Location Based Services (LBS) is pretty new, and there are not much literature around that could provide relevant interests to this matter, I have the following questions to ask:
First, I know that I have to design an Android App and possibly an phone app application. For all I am guessing, foursquare is simply using the client to send data to their webserver back and forth.
- What are the standard protocols for the client to communicate with the webserver? (or is it simply just json or xml?)
- What kind of special web service do they use on their backend? (Like some research would reveal they are using LIFT, written in Scala which is something that I am not familiar with.).
- I know python pretty well. Are there webservers, i.e. django or pylons, that provide similar service to 2) above?
- How difficult is this really?
Also, any literature on this subject matter is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 foursquare API。
他们在此处提供了适用于 Django 和 Python 的预制库,这些库应该可以更轻松地将 foursquare 集成到您的网站中。
Use the foursquare API.
They have pre-made libraries for both Django and Python here, those should make it easier to integrate foursquare into your website.
嗯,我确实认为一个好的第一步是查看 Foursquare 的 API,两者都是为了看看您是否可以简单地与他们的服务集成(即查找校园建筑或其他任何地方的签到),或者只是为了了解他们正在使用的内容。他们的 API 看起来像是一个使用 XML 或 JSON 的非常标准的 Web 服务,这对您来说似乎也是一个很好的实践。
构建可处理地理数据的可扩展 Web 服务存在一些挑战:您需要一个可以处理 地理空间索引为您服务(否则算法可能会变得有点复杂)。如果您熟悉 Django,GeoDjango 可能很适合您。我听说 Foursquare 实际上正在改用 MongoDB,它有一些 地理空间索引功能:它们可能使用 NoSQL 数据库,因为它们具有您可能不需要的独特的扩展问题担心。
Well, I do think a good first step would be to look at Foursquare's API, both to see if you can simply integrate with their service (i.e. look for check-ins that are to campus buildings or whatever) or just to get a picture of what they're using. Their API seems like a pretty standard web service using XML or JSON, which seems like a good practice for you as well.
There are some challenges in building a scalable web service that will handle geographic data: you'd want a database that can handle geospatial indexing for you (otherwise the algorithms can get a little complex). If you're familiar with Django, GeoDjango might be a good fit for you. I hear that Foursquare is actually switching to use MongoDB, which has some geospatial indexing features: they're likely using a NoSQL database because of their unique scaling issues which you probably don't need to worry about.
模仿 foursquare 并不是一个好方法。针对您的特定功能需求和负载级别的解决方案将始终是定制的,而不是复制的。即使是世界上最大的大学校园,如果每个人都使用该服务,与 foursquare 的用户群相比,你也会显得相形见绌。因此,无论他们所做的事情都比您需要的要高端得多。
就您的目的而言,简单的 Web 服务可能就足够了。我现在正在构建位置敏感的应用程序(艺术/文化活动和消费者在用户当前位置本地提供的服务),这些应用程序使用查询字符串或发布数据参数来访问 PHP 脚本,并使用 JSON。没什么特别的,但我可以使用我已经知道的轻量级技术来处理服务器端的负载,并且我知道它将扩展以满足我的实际负载。
不要受制于其他人的做法,即使他们是行业领导者。他们的需求不是你的需求。
Mimicking foursquare isn't a good approach. A solution to your specific functionality needs and load levels will always be custom, not copied. Even the biggest university campus in the world, with every single person using the service, you'd be totally dwarfed by foursquare's user base. So whatever they're doing is WAY higher-end than what you need.
For your purposes, a simple web service is probably more than adequate. I'm building apps that are location-sensitive (arts/cultural events and consumer offers local to the user's current position) right now that hit PHP scripts with query string or posted-data arguments, and consume JSON. Nothing fancy, but I can handle the load on the server side with lightweight technologies I already know, and I know it'll scale to meet my actual load.
Don't be beholden to the way somebody else does it, even if they are the industry leader. Their needs aren't your needs.