Friday, February 1, 2008

[Gd] URLs are People, Too

| More

Google Code Blog: URLs are People, Too

So you've just built a totally sweet new social app and you can't wait for people to start using it, but there's a problem: when people join they don't have any friends on your site. They're lonely, and the experience isn't good because they can't use the app with people they know. You could ask them to search for and add all their friends, but you know that every other app is asking them to do the same thing and they're getting sick of it. Or they tried address book import, but that didn't totally work, because they don't even have all their friends' email addresses (especially if they only know them from another social networking site!). What's a developer to do?

One option is the new Social Graph API, which makes information about the public connections between people on the Web easily available and useful. You can make it easy for users to bring their existing social connections into a new website and as a result, users will spend less time rebuilding their social networks and more time giving your app the love it deserves.

Here's how it works: we crawl the Web to find publicly declared relationships between people's accounts, just like Google crawls the Web for links between pages. But instead of returning links to HTML documents, the API returns JSON data structures representing the social relationships we discovered from all the XFN and FOAF. When a user signs up for your app, you can use the API to remind them who they've said they're friends with on other sites and ask them if they want to be friends on your new site.

The video below can walk you through the API in detail, but if you're eager to get started check out the Social Graph API homepage and the developer documentation. And let us know what you think in the Social Graph API Group.


Wednesday, January 30, 2008

[Gd] Article: Creating a Store Locator with PHP & MySQL

| More

Official Google Maps API Blog: Article: Creating a Store Locator with PHP & MySQL

I know, I know. Another PHP/MySQL article! I swore that my next article would be something completely different, but then my colleague emailed me some SQL for distance calculation, I plugged it into the PHP code from previous articles, and the result was just too cool and easy that I had to share it with you all.

The article goes over the usual - setting up the database (this one uses pizza restaurant data from all over the U.S.), querying the database with a SQL statement based on the Haversine formula, outputting the XML, and then hooking it up to a nice UI that performs a geocode based on a user-entered address, and then displays the n-nearest locations on a map within a user-selected radius. A screenshot of the final map is shown below:

To any chain stores out there that aren't using the Google Maps API yet (I know, perish the thought!) - the excuses are over, and the time has come to implement. And to people who don't have stores to locate - the time has come for you to become an entrepreneur and start-up your own chain of businesses. Here are some ideas of mine that would make for wicked cute map icons: a pizza buffet (all you can eat pizza, including dessert pizzas!), a boba bar (alcohol + caramelized tapioca pearls = yum!), or a "pamela's patented puffsters" diner (George Foreman grill + Bisquick pancake mix = half fluffy, half crispy, all delicious!). I expect 50% split of the profits, of course.

As always, please give feedback on this article in the forum.


Tuesday, January 29, 2008

[Gd] Interview with Steve Yegge on Rhino on Rails and more

| More

Google Code Blog: Interview with Steve Yegge on Rhino on Rails and more

Last year, Steve Yegge posted about Rhino on Rails, his port of Ruby on Rails to the JavaScript language on the Rhino runtime. It garnered a slew of interest, and I have been wanting to talk to him in more detail about the project.

Fortunately, I happened to be at the Google Kirkland office and Steve graciously had time to spend talking about the framework. Steve is an entertaining chap, and manages to keep you interested with long blog entries, and did the same as I chatted with him.

In the conversation we cover the germination of the project, why Steve went ahead with the port, the side effects of JavaScript on the server, how Rhino will be implementing JavaScript 2 / ECMAScript 4 (with Google committing engineers to the project), the intent to open source RnR, and random thoughts from a language geek.

Give it a watch, and let us know if there are any other questions you would have liked to ask


Sunday, January 27, 2008

[Gd] Put your map on the map!

| More

Official Google Maps API Blog: Put your map on the map!

I'm Bill Chadwick, a Google Maps API developer from the UK. In my spare time I like to go caving. We cavers like to see how caves relate to the surface features so overlaying cave surveys on Google Maps was something I wanted to try out.  A cave map is just one kind of special map though - other kinds include footpath networks, cycling routes, public transport routes, flood risk areas, historic maps, etc.

Some of these special maps could be shown on Google Maps using KML files or GPolylines/GPolygons, but those techniques requires that you have detailed coordinates of the objects you want to plot. What do you do if all you have is a map image (perhaps scanned in from paper)?

Well, Microsoft might just have your answer in the form of their free MapCruncher for Virtual Earth. MapCruncher will read in your map (jpg, transparent png, PDF, etc.), let you register it with the real world and at the click of a button, make a tile set ready for use as a custom GMaps tile layer. This works because by happy coincidence, Microsoft Virtual Earth and the Google Maps API use the same map projection and tiling scheme. MapCruncher takes care of all the rotating and warping of your map that is required for it to correctly appear in GMaps. An example of what can easily be achieved from a scanned-in map is shown in the map below. When the Satellite+Caves map is toggled on, you can drag the button on the +/- slider to adjust the transparency of the custom cave layer.

If this sounds like something you want to try with some maps of your own, you can read my comprehensive set of instructions on using MapCruncher with Google Maps. Oh, and in case you're wondering — the reason I am muddy and smiling in my portrait is because it was taken in late 2006 when we had just found this new cave passage.

Link to example caves map