google apis why aren’t you using them? jeff blankenburg project engineer quick solutions, inc....
TRANSCRIPT
Google APIsGoogle APIsWhy Aren’t You Using Them?
Jeff BlankenburgProject Engineer
Quick Solutions, Inc.
[email protected]://blog.jexed.com
Currently Available APIsCurrently Available APIs
All of the APIs can be found at http://code.google.com
Account Authentication
AdSense
AdWordsCalendar
Checkout
Spreadsheets
YouTube
SearchMaps
Blogger
Earth
GadgetsGroups
Picasa
Search History
Site Maps
Talk
Google Maps APIGoogle Maps API
Google Maps requires an API key to work.
Keys are freely available at:◦http://www.google.com/apis/maps/
Key is referenced in a JavaScript include file that must live on every page.
Google Maps APIGoogle Maps API
It takes two lines of code to get a Google map on your page.
var map = new GMap2(document.getElementById("map"));map.setCenter(new GLatLng(40.146212, -82.994824), 13);
Launch
Google Maps APIGoogle Maps API
A few more lines results in maps controls for zoom and pan.
var map = new GMap2(document.getElementById("map"));var point = new GLatLng(40.146212, -82.994824);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.addControl(new GOverviewMapControl());map.setCenter(point, 13);
Launch
Google Maps APIGoogle Maps API
You can also add events to almost anything on the map.
var map = new GMap2(document.getElementById("map"));var point = new GLatLng(40.146212, -82.994824);GEvent.addListener(map, "moveend",
function() {var center = map.getCenter();alert("MAP CENTER: \n" +
center.toString());});GEvent.addListener(map, "mouseout“,
function() {alert(“You’re done dragging?");});
map.setCenter(point, 13);
Launch
Google Maps APIGoogle Maps API
All of this stuff is great, but what if you don’t know your latitude and longitude?
var address = "8850 S. Old St. Rd., Columbus, OH 43240";var map = new GMap2(document.getElementById("map"));var geocoder = new GClientGeocoder();geocoder.getLatLng(address,
function(point){if (point){map.setCenter(point, 13);var marker = new GMarker(point);map.addOverlay(marker);marker.openInfoWindowHtml(address);}});
Launch
Google Maps APIGoogle Maps API
There’s plenty you can do with these maps,it just takes a little imagination.
GogglesFlight Sim
BigBoxWatchRed Light Cameras
U.S.Breweries
Project Management
My Sample Demo
Google Checkout APIGoogle Checkout API
Google Checkout is complete e-commerce service.
There are 3 levels of integration:
• Easy (creating checkout buttons)
• Medium (creating a form dynamically and posting it)
• Hard (creating web services for a back-and-forth transactional model that can be nearly transparent.)
Seller Site Buyer Site
Google Checkout API - EasyGoogle Checkout API - Easy
Once you have a Checkout Merchant ID (2-3 days), you can create buttons to put on your site.
You write no real code, but end up with no real functionality. Just basic “Buy Now” buttons.
You can sell one product at a time, with no shopping cart functionality.
Google Checkout API - EasyGoogle Checkout API - EasyLaunch
<form action="https://sandbox.google.com/checkout/cws/v2/Merchant/352649253823257/checkout" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm">
<img class="product" src=http://static.flickr.com/24/66271103_ae0b3385ec.jpg border="1"/>
<input name="cart" type="hidden" value=“HEXKEY"/>
<input name="signature" type="hidden“ value="cffcsirw+mn/KGCPZ96tcR7UYMM="/>
<input alt="" src="https://sandbox.google.com/checkout/buttons/buy.gif?merchant_id=352649253823257&w=117&h=48&style=white&variant=text&loc=en_US" type="image"/>
</form>
Google Checkout API - MediumGoogle Checkout API - Medium
You can create an HTML form on the fly for the user’s cart.
Post it to the Google server, where the user logs in, and pays there.
Actually pretty robust, good for most merchants.
Launch
Google Checkout API - MediumGoogle Checkout API - Medium
<form method="POST" action="https://sandbox.google.com/checkout/cws/v2/Merchant/352649253823257/checkoutForm" accept-charset="utf-8"> <input type="hidden" name="item_name_1" value="Chunky Peanut Butter"/>
<input type="hidden" name="item_description_1" value="Chunky peanut butter."/> <input type="hidden" name="item_quantity_1" value="6"/> <input type="hidden" name="item_price_1" value="3.75"/>
<input type="hidden" name="item_name_2" value="Creamy Peanut Butter"/> <input type="hidden" name="item_description_2" value="Creamy peanut butter."/> <input type="hidden" name="item_quantity_2" value="2"/> <input type="hidden" name="item_price_2" value="3.50"/>
<input type="hidden" name="ship_method_name_4" value="In-store Pickup"/> <input type="hidden" name="ship_method_price_4" value="0"/>
<input type="hidden" name="ship_method_name_1" value="Carrier Pidgeon"/> <input type="hidden" name="ship_method_price_1" value="1.50"/> <input type="hidden" name="ship_method_name_2" value="UPS Ground"/> <input type="hidden" name="ship_method_price_2" value="10.99"/>
<input type="hidden" name="ship_method_name_3" value="Teleporter"/> <input type="hidden" name="ship_method_price_3" value="24.99"/>
<input type="hidden" name="tax_rate" value="0.0875"/> <input type="hidden" name="tax_us_state" value="NY"/>
<input type="image" name="Google Checkout" alt="Fast checkout through Google" src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=352649253823257&w=180&h=46&style=white&variant=text&loc=en_US" height="46" width="180"/>
</form>
Launch
Google Checkout API - HardGoogle Checkout API - Hard
Everything is done via a set of XML web services.
You can update your systems (shipping status, etc), and Google’s interface will represent that data as well.
Incredibly robust, and ties in well with many existing shopping cart offerings.
http://code.google.com/apis/checkout/
Sample Code
The Hard implementation probably deserves its own presentation, in a specific language.
Google Checkout ExamplesGoogle Checkout Examples
Some examples of Google Checkout implementations.
buy.com toysrus.com starbucks.com
Master List of Google Checkout Vendors
Google Calendar APIGoogle Calendar API
Calendar APIs are still in their infancy.
You can access a Google Calendar either via a pre-formatted <iframe> element, or by directly accessing the XML feed.
By directly tying into the API, you can also post events back to a calendar for adds and updates.
All the API documentation is presented only in Java, currently, but should translate well to .NET.
Google Calendar XML FileGoogle Calendar XML File
This is an example of a Google Calendar XML file.
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005‘>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/g/2005#event'></category>
<title type='text'>Tennis with Beth</title>
<content type='text'>Meet for a quick lesson.</content>
<author>
<name>Jo March</name>
<email>[email protected]</email>
</author>
<gd:transparency value='http://schemas.google.com/g/2005#event.opaque'> </gd:transparency>
<gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed'> </gd:eventStatus>
<gd:where valueString='Rolling Lawn Courts'></gd:where>
<gd:when startTime='2006-04-17T15:00:00.000Z' endTime='2006-04-17T17:00:00.000Z'>
</gd:when>
</entry>
Google Calendar ImplementationGoogle Calendar Implementation
You can keep your data in your calendar,and expose it to your audience.
Google Calendar
Google Calendar using
the API
Google Calendar as an
XML file
Google APIs – Questions?Google APIs – Questions?
Google APIs…They’re so easy even a caveman could do it.
Jeff BlankenburgProject Engineer, Quick [email protected](614) 327-5066