Workshop Event: Discussion and self-learning of Google Places API

20 views
Skip to first unread message

Sathish VJ

unread,
Oct 22, 2012, 5:56:51 AM10/22/12
to gtug-ba...@googlegroups.com
Hello,

I'm coordinating a small self-learning workshop for Google Places API.  If you are interested, please do come by and be part of the learning.  

Workshop: We will study the docs ourselves and write small apps (web or mobile depending on your preference) to use the Google Places API.  We will help each other and assist with discussions and reviews of how to use it.

Pre-requisites: Bring your laptops, and if you have one, your USB internet dongle.  You should have some existing experience with programming (web or mobile, depending on what you want to do.

Goal: We shall get together and use the Google Places API a bit so that GDG Bangalore will have that collective expertise.  Those who are participating in the Google Developer Challenge with Places API can also get some preliminary hands-on experience and can use this practice to refine their apps and submit a good one.  

Time: Saturday, 27th October, 2012. 10am to 12:30pm.
Location: Jaaga (Courtyard Cafe), No. 68, KH Road, Bangalore 560 027 (http://jaaga.in/contact) Landmarks: Close to Shanthi Nagar bus stand, and opposite to Corporation Bank. fyi, KH road is also known as Double Road. http://goo.gl/maps/tPMf1

cheers
Sathish

Sathish VJ

unread,
Oct 24, 2012, 11:30:06 AM10/24/12
to gtug-ba...@googlegroups.com
A couple of updates ... 
* tried out a few javascript samples with the places API and it was fairly simple ... hope to also try out a 'server side' application with the api in the coming days.  So I should be able to help out the attendees a bit to kick off the self learning.
* I'm expecting only very few people given that it is a hands-on programming workshop and it is also a lengthy weekend, so if you are planning to attend, could you please send me a personal mail with your name and existing tech expertise so that I know who to expect.

* Important note: the venue management has told me that they will charge Rs. 100 for the internet connection on a per person basis, which I can ill afford.  So if you have it, please bring your own USB data dongles.
(I'll try to buy a USB data connection myself which I should be able to share over an ad-hoc network, but since I'm arriving in Bangalore only just prior to the event, I might not be able to get it on time.  If you know individuals or companies who are willing to sponsor such events/workshops also, please let me know as that will be very helpful, encouraging, and supportive.)

regards
Sathish

Sathish VJ

unread,
Oct 24, 2012, 4:24:24 PM10/24/12
to gtug-ba...@googlegroups.com
Finished a sample side program also.  For those who know Go, you can use this directly.  Otherwise modify it for your own language.
Of course, these samples are easy to do ... but the interesting thing will be to see how people can put it together to make some relevant apps.

//filename: main.go
package main

import (
"fmt"
"html/template"
"io/ioutil"
"log"
"net/http"
)

const API_KEY = "ADD YOUR API KEY HERE"

func main() {
http.HandleFunc("/", handleRoot)
http.HandleFunc("/nearby", handleNearby)

http.ListenAndServe("localhost:8080", nil)
}

func handleRoot(w http.ResponseWriter, r *http.Request) {
t, err := template.New("main").ParseFiles("main.go.html")
if err != nil {
log.Fatal(err)
}
if err = t.ExecuteTemplate(w, "main", nil); err != nil {
log.Fatal(err)
}
}

func handleNearby(w http.ResponseWriter, r *http.Request) {
        lat, long, radius, typ := r.FormValue("lat"), r.FormValue("long"), r.FormValue("radius"), r.FormValue("types")

url := "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=" + lat + "," + long + "&radius=" + radius + "&types=" + typ + "&sensor=false&key=" + API_KEY

res, err := http.Get(url)
if err != nil {
log.Fatal(err)
}

data, err := ioutil.ReadAll(res.Body)
res.Body.Close()

if err != nil {
log.Fatal(err)
}

fmt.Fprintf(w, "%s", string(data))
}

//file: main.go.html
{{define "main"}}
<!DOCTYPE html>
<html>
<body>
<form action="/nearby" method="GET">
Latitude: <input type="text" name="lat" value="12.9833"/><br/>
Longitude: <input type="text" name="long" value="77.5833" /><br/>
Radius: <input type="text" name="radius" value="500" /><br/>
Type: <select name="types">
<option>restaurant</option>
<option>bank</option>
<option>cafe</option>
<option>bus_station</option>
<option>pharmacy</option>
</select> <br/>
<input type="submit" />

</form>
</body>
</html>
{{end}}

On Monday, 22 October 2012 15:26:52 UTC+5:30, Sathish VJ wrote:
Reply all
Reply to author
Forward
0 new messages