SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

卓承妹
卓承妹卓承妹
卓承妹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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Kürzlich hochgeladen (20)

Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

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