SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
A World Beyond AJAX:
Accessing Google's APIs from
Flash and other Non-
JavaScript Environments
Vadim Spivak
5/29/2008
Introduction

  APIs
     Google AJAX Search API
     Google AJAX Feed API
     Google AJAX Language API
  Goals
     Show how easy it is to use the RESTful interface
     Go through several use cases where the traditional
     JavaScript library does not work
          Latency sensitive websites
          Flash/Silverlight
          Server-side
Google AJAX Search API

  Web
  Video
  News
  Image
  Local
  Book
  Blog
Sample
var videobar = new GSvideoBar(
document.getElementById(quot;videoBarHorizontalquot;),
GSvideoBar.PLAYER_ROOT_FLOATING,
{largeResultSet : false, horizontal : true});
videobar.execute(“ytchannel:nbaquot;);
Customers
Google AJAX Feed API

  Load
  Find
  Lookup
Sample
var feed =
quot;http://www.google.com/uds/solutions/slideshow/sample.rssquot;;
var slideshow = new GFslideShow(samples, quot;sampleSlideshowquot;,
{ linkTarget : google.feeds.LINK_TARGET_BLANK,
fullControlPanel : true });
Customers
Google AJAX Language API

  Translate
  Detect Language
Sample
google.language.translate(quot;Hello Worldquot;, quot;enquot;, quot;esquot;,
function(result) {
alert(result.translation);
}
);
Customers
The Basic Blocks




JavaScript Controls and UI elements



JavaScript Runtime Layer

                                      AJAX APIs
RESTful Data Access Layer
Why?

  Restricted or no access to JavaScript
  Tighter integration
  Latency sensitive application




       Flash                                 Silverlight
                        Facebook


               iPhone              Android
Interface

  RESTful
     HTTP
     Read Only
  JSON
     Lightweight
     Text Based
     Compact
     Language Independent
Sample API Request

curl “http://ajax.googleapis.com/ajax/services/feed/load?
v=1.0&num=1&q=http://digg.com/rss/index.xmlquot;

{
  quot;responseDataquot;: {
   quot;feedquot;: {
     quot;titlequot;: quot;Diggquot;,
     quot;linkquot;: quot;http://digg.com/quot;,
     quot;entriesquot;: [
       {
         quot;titlequot;: quot;LittleBigPlanet Killzonequot;,
         quot;publishedDatequot;: quot;Wed, 07 May 2008 21:20:09 -0700quot;,
         quot;contentquot;: quot;Just to show off how ...quot;
       }
     ]
   }
},
quot;responseDetailsquot;: null,
quot;responseStatusquot;: 200
}
crossdomain.xml

     Allows cross-domain requests in Flash and Silverlight
     http://ajax.googleapis.com/crossdomain.xml
<?xml version=quot;1.0quot;?>
<!DOCTYPE cross-domain-policy SYSTEM quot;http://www.macromedia.
com/xml/dtds/cross-domain-policy.dtdquot;>
<cross-domain-policy>
<allow-access-from domain=quot;*quot; />
</cross-domain-policy>
Fine Print

   Referrer
      Specify the URL where the API results are being displayed
      Fall back to homepage URL if necessary
      Optionally specify API key
   Limitations
Examples
Faster AJAX
 Traditional example

<script src=quot;http://www.google.com/jsapiquot;
type=quot;text/javascriptquot;></script>
<script language=quot;Javascriptquot; type=quot;text/javascriptquot;>
google.load(quot;feedsquot;, quot;1quot;);
google.setOnLoadCallback(OnLoad);

function OnLoad() {
var feed = new google.feeds.Feed(
quot;http://www.digg.com/rss/index.xmlquot;);
feed.load(FeedLoaded);
}

function FeedLoaded(result) {
//...
}
</script>
Faster AJAX
DOMContentLoaded
   Faster than OnLoad
   Cross browser
   google.setOnLoadCallback(fn, onDomContentLoaded)
Faster AJAX
 JSON with Padding
      Callback

$ curl quot;http://ajax.googleapis.com/ajax/services/feed/load?
callback=FeedLoaded&v=1.0&num=1&q=http://digg.com/rss/index.xmlquot;

FeedLoaded({
 quot;responseDataquot;: {
   quot;feedquot;: {
     quot;titlequot;: quot;Diggquot;,
     quot;entriesquot;: [
       {
         quot;titlequot;: quot;LittleBigPlanet Killzonequot;,
         quot;contentquot;: quot;Just to show off how ...quot;
       }
     ]
   }
 },
 quot;responseDetailsquot;: null,
 quot;responseStatusquot;: 200
})
Faster AJAX
 Updated example
     Response returned before OnLoad or DOMContentLoaded
     1 request vs. 3 requests (10K less in size)
<script language=quot;Javascriptquot; type=quot;text/javascriptquot;>
function FeedLoaded(result) {
//...
}
</script>

<script src=quot;
http://ajax.googleapis.com/ajax/services/feed/load?
callback=FeedLoaded&v=1.0&num=1&
q=http://digg.com/rss/index.xmlquot;>
</script>
Demo

 Traditional
 Traditional with onDOMContentLoaded
 Direct JSON-P
News Bar

  Popular solution built using Google AJAX Search API
  Simple yet makes static content more sticky
  Limited to sites who allow third party JavaScript widgets
News Bar
In Flash
    ActionScript 3
           HTTPService
    MXML
    corelib
News Bar
 Code snippet
var service:HTTPService = new HTTPService();
service.url = 'http://ajax.googleapis.
com/ajax/services/search/news';
service.request.v = '1.0';
service.request.q = ‘Playstation';
service.resultFormat = 'text';
service.addEventListener(ResultEvent.RESULT, onServerResponse);
service.send();

private function onServerResponse(event:ResultEvent):void {
try {
var json:Object = JSON.decode(event.result as String);
// now display the results...
} catch(ignored:Error) {
}
}
Demo
Server Side
Translated Wall Attachments
   Facebook Application
   Google App Engine
   Google AJAX Language API
Server Side
Translated Wall Attachments
   URL Fetch API
   simplejson
   gminifb
Server Side
 Code snippet
def translate(s, lang):
params = {
'v' : '1.0',
'q' : s,
'langpair' : '|%s' % lang
}

response = urlfetch.fetch('http://ajax.googleapis.com/ajax/'
'services/language/translate?%s' % urllib.urlencode(params))
data = simplejson.loads(response.content)
if data['responseStatus'] != 200:
return 'Error translating message.'
else:
return data['responseData']['translatedText'])
Demo
Reference

  General Documentation
     http://code.google.com/apis/ajaxsearch
     http://code.google.com/apis/ajaxfeeds
     http://code.google.com/apis/ajaxlanguage
  Complete source code for the presented examples
     http://code.google.com/p/google-ajax-examples
A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script Environments

Contenu connexe

Tendances

ASP.NET 12 - State Management
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State ManagementRandy Connolly
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introductiondynamis
 
HTML5: a quick overview
HTML5: a quick overviewHTML5: a quick overview
HTML5: a quick overviewMark Whitaker
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Divyanshu
 
Web II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET WorksWeb II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET WorksRandy Connolly
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overviewreybango
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NETgoodfriday
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1Biswadip Goswami
 
From CRUD to Hypermedia APIs with Spring
From CRUD to Hypermedia APIs with SpringFrom CRUD to Hypermedia APIs with Spring
From CRUD to Hypermedia APIs with SpringVladimir Tsukur
 
Pragmatics of Declarative Ajax
Pragmatics of Declarative AjaxPragmatics of Declarative Ajax
Pragmatics of Declarative Ajaxdavejohnson
 
Fronteers 20091105 (1)
Fronteers 20091105 (1)Fronteers 20091105 (1)
Fronteers 20091105 (1)guestbf04d7
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008Association Paris-Web
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#priya Nithya
 
Internet protocalls & WCF/DReAM
Internet protocalls & WCF/DReAMInternet protocalls & WCF/DReAM
Internet protocalls & WCF/DReAMWoody Pewitt
 
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationHTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationTodd Anglin
 

Tendances (20)

ASP.NET 12 - State Management
ASP.NET 12 - State ManagementASP.NET 12 - State Management
ASP.NET 12 - State Management
 
HTML5 Introduction
HTML5 IntroductionHTML5 Introduction
HTML5 Introduction
 
HTML5: a quick overview
HTML5: a quick overviewHTML5: a quick overview
HTML5: a quick overview
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup
 
Web II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET WorksWeb II - 02 - How ASP.NET Works
Web II - 02 - How ASP.NET Works
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1
 
Looking into HTML5
Looking into HTML5Looking into HTML5
Looking into HTML5
 
From CRUD to Hypermedia APIs with Spring
From CRUD to Hypermedia APIs with SpringFrom CRUD to Hypermedia APIs with Spring
From CRUD to Hypermedia APIs with Spring
 
Pragmatics of Declarative Ajax
Pragmatics of Declarative AjaxPragmatics of Declarative Ajax
Pragmatics of Declarative Ajax
 
High-Speed HTML5
High-Speed HTML5High-Speed HTML5
High-Speed HTML5
 
New Browsers
New BrowsersNew Browsers
New Browsers
 
Fronteers 20091105 (1)
Fronteers 20091105 (1)Fronteers 20091105 (1)
Fronteers 20091105 (1)
 
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
IE 8 et les standards du Web - Chris Wilson - Paris Web 2008
 
Html server control - ASP. NET with c#
Html server control - ASP. NET with c#Html server control - ASP. NET with c#
Html server control - ASP. NET with c#
 
Internet protocalls & WCF/DReAM
Internet protocalls & WCF/DReAMInternet protocalls & WCF/DReAM
Internet protocalls & WCF/DReAM
 
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationHTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
 

En vedette

卓承妹
卓承妹卓承妹
卓承妹nice567
 
Founders guild epiphany
Founders guild epiphanyFounders guild epiphany
Founders guild epiphanySteve Newcomb
 
Indian Railways Toilet's Ergonomic Analysis
Indian Railways Toilet's Ergonomic AnalysisIndian Railways Toilet's Ergonomic Analysis
Indian Railways Toilet's Ergonomic AnalysisShashikant Tewary
 
Isurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis OverviewIsurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis OverviewRadwich
 
Albeniz Tango Op.165 N°2 (Violin And Piano)
Albeniz  Tango Op.165 N°2 (Violin And Piano)Albeniz  Tango Op.165 N°2 (Violin And Piano)
Albeniz Tango Op.165 N°2 (Violin And Piano)HOME
 
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...GoogleTecTalks
 
2009 De Groeve Iscram Conference
2009 De Groeve Iscram Conference2009 De Groeve Iscram Conference
2009 De Groeve Iscram Conferencedegroeve
 
Keynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudKeynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudGoogleTecTalks
 
Autumn
AutumnAutumn
AutumnHOME
 
Show 67 ecommerce-product
Show 67 ecommerce-productShow 67 ecommerce-product
Show 67 ecommerce-productErin Sparks
 
Christmas Carol Songbook Voice, Satb Various
Christmas Carol Songbook   Voice, Satb   VariousChristmas Carol Songbook   Voice, Satb   Various
Christmas Carol Songbook Voice, Satb VariousHOME
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To AndroidGoogleTecTalks
 
Beethoven Romances
Beethoven RomancesBeethoven Romances
Beethoven RomancesHOME
 
Show 63 | Websites Are Dead | Edge of the Web Radio
Show 63 | Websites Are Dead | Edge of the Web RadioShow 63 | Websites Are Dead | Edge of the Web Radio
Show 63 | Websites Are Dead | Edge of the Web RadioErin Sparks
 
MONETRY SECTOR OF PAKISTAN
MONETRY SECTOR OF PAKISTANMONETRY SECTOR OF PAKISTAN
MONETRY SECTOR OF PAKISTANnosscire.3299
 
Getting published – how the library can help
Getting published – how the library can helpGetting published – how the library can help
Getting published – how the library can helpbradscifi
 
Cooking Lessons Clos Des Arts****L
Cooking Lessons Clos Des Arts****LCooking Lessons Clos Des Arts****L
Cooking Lessons Clos Des Arts****Lodelia
 

En vedette (20)

卓承妹
卓承妹卓承妹
卓承妹
 
Founders guild epiphany
Founders guild epiphanyFounders guild epiphany
Founders guild epiphany
 
Indian Railways Toilet's Ergonomic Analysis
Indian Railways Toilet's Ergonomic AnalysisIndian Railways Toilet's Ergonomic Analysis
Indian Railways Toilet's Ergonomic Analysis
 
Isurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis OverviewIsurus Market Opportunity Analysis Overview
Isurus Market Opportunity Analysis Overview
 
助聽器
助聽器助聽器
助聽器
 
Albeniz Tango Op.165 N°2 (Violin And Piano)
Albeniz  Tango Op.165 N°2 (Violin And Piano)Albeniz  Tango Op.165 N°2 (Violin And Piano)
Albeniz Tango Op.165 N°2 (Violin And Piano)
 
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
13353102 Putting The Fun In Functional Applying Game Mechanics To Functional ...
 
2009 De Groeve Iscram Conference
2009 De Groeve Iscram Conference2009 De Groeve Iscram Conference
2009 De Groeve Iscram Conference
 
Keynote Client Connectivity And The Cloud
Keynote Client Connectivity And The CloudKeynote Client Connectivity And The Cloud
Keynote Client Connectivity And The Cloud
 
Autumn
AutumnAutumn
Autumn
 
Show 67 ecommerce-product
Show 67 ecommerce-productShow 67 ecommerce-product
Show 67 ecommerce-product
 
Planta Poder
Planta PoderPlanta Poder
Planta Poder
 
Christmas Carol Songbook Voice, Satb Various
Christmas Carol Songbook   Voice, Satb   VariousChristmas Carol Songbook   Voice, Satb   Various
Christmas Carol Songbook Voice, Satb Various
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Beethoven Romances
Beethoven RomancesBeethoven Romances
Beethoven Romances
 
Show 63 | Websites Are Dead | Edge of the Web Radio
Show 63 | Websites Are Dead | Edge of the Web RadioShow 63 | Websites Are Dead | Edge of the Web Radio
Show 63 | Websites Are Dead | Edge of the Web Radio
 
MONETRY SECTOR OF PAKISTAN
MONETRY SECTOR OF PAKISTANMONETRY SECTOR OF PAKISTAN
MONETRY SECTOR OF PAKISTAN
 
Getting published – how the library can help
Getting published – how the library can helpGetting published – how the library can help
Getting published – how the library can help
 
Cooking Lessons Clos Des Arts****L
Cooking Lessons Clos Des Arts****LCooking Lessons Clos Des Arts****L
Cooking Lessons Clos Des Arts****L
 
CPI CONCEPTES
CPI CONCEPTESCPI CONCEPTES
CPI CONCEPTES
 

Similaire à A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script Environments

CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2Geoffrey Fox
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax IntroductionOliver Cai
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Steve Souders
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp ArchitectureMorgan Cheng
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyMark Meeker
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Developmentvito jeng
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009marpierc
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologiesgeorge.james
 
Decoding the Web
Decoding the WebDecoding the Web
Decoding the Webnewcircle
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Lecture 11 Answers
Lecture 11 AnswersLecture 11 Answers
Lecture 11 Answersis4030.ray
 

Similaire à A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script Environments (20)

CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2CTS Conference Web 2.0 Tutorial Part 2
CTS Conference Web 2.0 Tutorial Part 2
 
GWT
GWTGWT
GWT
 
Ajax Introduction
Ajax IntroductionAjax Introduction
Ajax Introduction
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
 
Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09Even Faster Web Sites at jQuery Conference '09
Even Faster Web Sites at jQuery Conference '09
 
Single Page WebApp Architecture
Single Page WebApp ArchitectureSingle Page WebApp Architecture
Single Page WebApp Architecture
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)
Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)
Intro on GWT & Google APIs (Vikram Rangnekar, COO of Socialwok.com)
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case Study
 
Ajax3
Ajax3Ajax3
Ajax3
 
JavaScript Web Development
JavaScript Web DevelopmentJavaScript Web Development
JavaScript Web Development
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
 
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar TechnologiesRob Tweed :: Ajax and the Impact on Caché and Similar Technologies
Rob Tweed :: Ajax and the Impact on Caché and Similar Technologies
 
M Ramya
M RamyaM Ramya
M Ramya
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Decoding the Web
Decoding the WebDecoding the Web
Decoding the Web
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Ajax
AjaxAjax
Ajax
 
Lecture 11 Answers
Lecture 11 AnswersLecture 11 Answers
Lecture 11 Answers
 
Fast by Default
Fast by DefaultFast by Default
Fast by Default
 

Plus de GoogleTecTalks

Web Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of TomorrowWeb Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of TomorrowGoogleTecTalks
 
Using The Google Collections Library For Java
Using The Google Collections Library For JavaUsing The Google Collections Library For Java
Using The Google Collections Library For JavaGoogleTecTalks
 
Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009GoogleTecTalks
 
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...GoogleTecTalks
 
New Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be SpideredNew Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be SpideredGoogleTecTalks
 
Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In BrowsersGoogleTecTalks
 
Black Cloud Patterns Toward The Future
Black Cloud Patterns Toward The FutureBlack Cloud Patterns Toward The Future
Black Cloud Patterns Toward The FutureGoogleTecTalks
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpGoogleTecTalks
 
Advanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap IsAdvanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap IsGoogleTecTalks
 

Plus de GoogleTecTalks (10)

Web Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of TomorrowWeb Hooks And The Programmable World Of Tomorrow
Web Hooks And The Programmable World Of Tomorrow
 
Using The Google Collections Library For Java
Using The Google Collections Library For JavaUsing The Google Collections Library For Java
Using The Google Collections Library For Java
 
Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009Voice Browsing And Multimodal Interaction In 2009
Voice Browsing And Multimodal Interaction In 2009
 
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
V Code And V Data Illustrating A New Framework For Supporting The Video Annot...
 
New Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be SpideredNew Media Mavericks Will The Revolution Be Spidered
New Media Mavericks Will The Revolution Be Spidered
 
Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In Browsers
 
Black Cloud Patterns Toward The Future
Black Cloud Patterns Toward The FutureBlack Cloud Patterns Toward The Future
Black Cloud Patterns Toward The Future
 
Advanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch UpAdvanced Ruby Scripting For Sketch Up
Advanced Ruby Scripting For Sketch Up
 
Advanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap IsAdvanced Gadget And Ui Development Using Googles Ajax Ap Is
Advanced Gadget And Ui Development Using Googles Ajax Ap Is
 
Advanced Kml
Advanced KmlAdvanced Kml
Advanced Kml
 

Dernier

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

A World Beyond Ajax Accessing Googles Ap Is From Flash And Non Java Script Environments

  • 1. A World Beyond AJAX: Accessing Google's APIs from Flash and other Non- JavaScript Environments Vadim Spivak 5/29/2008
  • 2. Introduction APIs Google AJAX Search API Google AJAX Feed API Google AJAX Language API Goals Show how easy it is to use the RESTful interface Go through several use cases where the traditional JavaScript library does not work Latency sensitive websites Flash/Silverlight Server-side
  • 3. Google AJAX Search API Web Video News Image Local Book Blog
  • 4. Sample var videobar = new GSvideoBar( document.getElementById(quot;videoBarHorizontalquot;), GSvideoBar.PLAYER_ROOT_FLOATING, {largeResultSet : false, horizontal : true}); videobar.execute(“ytchannel:nbaquot;);
  • 6. Google AJAX Feed API Load Find Lookup
  • 7. Sample var feed = quot;http://www.google.com/uds/solutions/slideshow/sample.rssquot;; var slideshow = new GFslideShow(samples, quot;sampleSlideshowquot;, { linkTarget : google.feeds.LINK_TARGET_BLANK, fullControlPanel : true });
  • 9. Google AJAX Language API Translate Detect Language
  • 10. Sample google.language.translate(quot;Hello Worldquot;, quot;enquot;, quot;esquot;, function(result) { alert(result.translation); } );
  • 12. The Basic Blocks JavaScript Controls and UI elements JavaScript Runtime Layer AJAX APIs RESTful Data Access Layer
  • 13. Why? Restricted or no access to JavaScript Tighter integration Latency sensitive application Flash Silverlight Facebook iPhone Android
  • 14. Interface RESTful HTTP Read Only JSON Lightweight Text Based Compact Language Independent
  • 15. Sample API Request curl “http://ajax.googleapis.com/ajax/services/feed/load? v=1.0&num=1&q=http://digg.com/rss/index.xmlquot; { quot;responseDataquot;: { quot;feedquot;: { quot;titlequot;: quot;Diggquot;, quot;linkquot;: quot;http://digg.com/quot;, quot;entriesquot;: [ { quot;titlequot;: quot;LittleBigPlanet Killzonequot;, quot;publishedDatequot;: quot;Wed, 07 May 2008 21:20:09 -0700quot;, quot;contentquot;: quot;Just to show off how ...quot; } ] } }, quot;responseDetailsquot;: null, quot;responseStatusquot;: 200 }
  • 16. crossdomain.xml Allows cross-domain requests in Flash and Silverlight http://ajax.googleapis.com/crossdomain.xml <?xml version=quot;1.0quot;?> <!DOCTYPE cross-domain-policy SYSTEM quot;http://www.macromedia. com/xml/dtds/cross-domain-policy.dtdquot;> <cross-domain-policy> <allow-access-from domain=quot;*quot; /> </cross-domain-policy>
  • 17. Fine Print Referrer Specify the URL where the API results are being displayed Fall back to homepage URL if necessary Optionally specify API key Limitations
  • 19. Faster AJAX Traditional example <script src=quot;http://www.google.com/jsapiquot; type=quot;text/javascriptquot;></script> <script language=quot;Javascriptquot; type=quot;text/javascriptquot;> google.load(quot;feedsquot;, quot;1quot;); google.setOnLoadCallback(OnLoad); function OnLoad() { var feed = new google.feeds.Feed( quot;http://www.digg.com/rss/index.xmlquot;); feed.load(FeedLoaded); } function FeedLoaded(result) { //... } </script>
  • 20. Faster AJAX DOMContentLoaded Faster than OnLoad Cross browser google.setOnLoadCallback(fn, onDomContentLoaded)
  • 21. Faster AJAX JSON with Padding Callback $ curl quot;http://ajax.googleapis.com/ajax/services/feed/load? callback=FeedLoaded&v=1.0&num=1&q=http://digg.com/rss/index.xmlquot; FeedLoaded({ quot;responseDataquot;: { quot;feedquot;: { quot;titlequot;: quot;Diggquot;, quot;entriesquot;: [ { quot;titlequot;: quot;LittleBigPlanet Killzonequot;, quot;contentquot;: quot;Just to show off how ...quot; } ] } }, quot;responseDetailsquot;: null, quot;responseStatusquot;: 200 })
  • 22. Faster AJAX Updated example Response returned before OnLoad or DOMContentLoaded 1 request vs. 3 requests (10K less in size) <script language=quot;Javascriptquot; type=quot;text/javascriptquot;> function FeedLoaded(result) { //... } </script> <script src=quot; http://ajax.googleapis.com/ajax/services/feed/load? callback=FeedLoaded&v=1.0&num=1& q=http://digg.com/rss/index.xmlquot;> </script>
  • 23. Demo Traditional Traditional with onDOMContentLoaded Direct JSON-P
  • 24. News Bar Popular solution built using Google AJAX Search API Simple yet makes static content more sticky Limited to sites who allow third party JavaScript widgets
  • 25. News Bar In Flash ActionScript 3 HTTPService MXML corelib
  • 26. News Bar Code snippet var service:HTTPService = new HTTPService(); service.url = 'http://ajax.googleapis. com/ajax/services/search/news'; service.request.v = '1.0'; service.request.q = ‘Playstation'; service.resultFormat = 'text'; service.addEventListener(ResultEvent.RESULT, onServerResponse); service.send(); private function onServerResponse(event:ResultEvent):void { try { var json:Object = JSON.decode(event.result as String); // now display the results... } catch(ignored:Error) { } }
  • 27. Demo
  • 28. Server Side Translated Wall Attachments Facebook Application Google App Engine Google AJAX Language API
  • 29. Server Side Translated Wall Attachments URL Fetch API simplejson gminifb
  • 30. Server Side Code snippet def translate(s, lang): params = { 'v' : '1.0', 'q' : s, 'langpair' : '|%s' % lang } response = urlfetch.fetch('http://ajax.googleapis.com/ajax/' 'services/language/translate?%s' % urllib.urlencode(params)) data = simplejson.loads(response.content) if data['responseStatus'] != 200: return 'Error translating message.' else: return data['responseData']['translatedText'])
  • 31. Demo
  • 32. Reference General Documentation http://code.google.com/apis/ajaxsearch http://code.google.com/apis/ajaxfeeds http://code.google.com/apis/ajaxlanguage Complete source code for the presented examples http://code.google.com/p/google-ajax-examples