Click Like If you Agree
Spent a few days searching for Google Latitude example
RUBY on RAILS and I am happy to say finally found a
good post on Google Latitude . I thought it would be great
to include this one in my blog as it already contained a lot of
stuff on Google Latitude .
Register Domain with Google
1) Go to: https://www.google.com/accounts/ManageDomains
Add a domain name if you have or
Get cheap and good web hosting ($7.99 per year)
Thats the cheapest price you can get on the web with
a large no of of features .
Hosting Includes 99.9% Uptime, RV Site Builder,
Fantastico Deluxe Scripts, Softaculous Auto Script
Installer, Ruby On Rails, Ruby Gems, Virus Scanner,
WHM cPanel w/ZamFoo 7.1, CGI, Perl, PHP 5, cURL &
They are not that famous I guess but definitely a good one.
After registering your domain , the next step is to create
an pair of RSA keys , this one is needed for encryption
of the data to be send during the OAuth Handshake .
In linux and OS X you can use openssl
openssl req -x509 -nodes -days 365 -newkey rsa:1024
-sha1 -subj ‘/C=US/ST=CA/L=San
Francisco/CN=example.com’ -keyout rsakey.pem -out
Upload the rsacert.pem, and keep the rsakey.pem in a
2) OAuth GEM
Include in your environment.rb
config.gem "oauth"You need to install it to use in your system .
Recommended version 0.4.1 .
3) Generate OAuth Access Toke Model
$ ruby script/generate model OAuthAccessToken
Note: I've done this because I don't want to store
create_table :oauth_access_tokens do |t|
t.string :oauth_token, :oauth_secret, :scope
t.string :subject_type, :limit > 30 #for polymorphic association
:model_name => 'OAuthAccessToken',
:as => :subject, :conditions => ['scope = ?','latitude']
5)Setup OAUTH Consumer for Latitude
Create class lib/o_auth_consumers.rb
Thanks to Ben Petro for creating the code on Ruby On Rails