Javascript, APIs and Mashups

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

  • + guest34b1ef guest34b1ef 2 years ago
    I recently build JAK (Javascript API Kernel) at http://avitar.net to address many of the issues other API’s suffer from. It is well documented, modular, open source, and easy to use. Go take a look and tell me what you think.



    BTW: nice slideshow.
  • + guest384dec guest384dec 2 years ago
    booty talk
Post a comment
Embed Video
Edit your comment Cancel

15 Favorites

Javascript, APIs and Mashups - Presentation Transcript

  1. work you don’t have to do JAVASCRIPT APIS & MASHUPS Kevin Yank www.sitepoint.com Cameron Adams www.themaninblue.com
  2.  
  3.  
  4.  
  5. APIS VS MASHUPS
    • both are very closely linked
    • to understand a mashup you first have to understand APIs
  6. WHAT’S AN API?
    • work you don’t have to do
  7.  
  8. APIS
    • A pplication P rogramming I nterface
      • an abstracted interface to 3 rd party programming
      • access someone else’s code without having to worry about the details
      • a general principle in software development
      • http://java.sun.com/j2ee/1.4/docs/api/
  9. WEB APIS
    • Far sexier than their desktop cousins
    • Operate on the same principles
    • But why do we need them?
  10.  
  11.  
  12. WHAT YOUR WEBSITE LOOKS LIKE TO A PROGRAMMER
  13. WHAT YOUR WEB 2.0 WEB SITE LOOKS LIKE TO A PROGRAMMER
  14. APIS LET PROGRAMMERS GET DATA OUT OF A WEBSITE
  15. Your website is an island
  16. Now it’s part of a true network
  17. WHAT DOES A WEB API LOOK LIKE?
    • usually accessed via HTTP
      • you don’t need any special technology to access a Web API, just your browser or a server HTTP connection
    • a call to a script on someone else’s server
    • http://www.flickr.com/services/api/
  18.  
  19. WEB API EXAMPLES
    • work you don’t have to do
  20. MAPPING APIS
    • Google Maps
      • best Australian images
      • good Australian maps
      • free for free sites
  21. MAPPING APIS
    • Google Maps
      • best Australian images
      • good Australian maps
      • free for free sites
    • Virtual Earth
      • good Australian images
      • good Australian maps
      • restrictive licensing
  22. MAPPING APIS
    • Google Maps
      • best Australian images
      • good Australian maps
      • free for free sites
    • Virtual Earth
      • good Australian images
      • good Australian maps
      • restrictive licensing
    • Yahoo! Maps
      • good Australian images
      • Flash or JavaScript
      • static image
  23. MAPPING APIS
    • Google Maps
      • best Australian images
      • good Australian maps
      • free for free sites
    • Virtual Earth
      • good Australian images
      • good Australian maps
      • restrictive licensing
    • Yahoo! Maps
      • good Australian images
      • Flash or JavaScript
      • static image
      • limited Australian maps
  24. MAPPING DEMO
  25. SEARCH APIS
    • Google
    • Yahoo!
    • MSN
    • providers
    • services
    • web search
    • web cache
    • spelling
    • content analysis
    • incoming links
  26. AMAZON
    • product information
      • prices
      • images
      • customer reviews
      • affiliate sales
  27. MANY, MANY MORE
    • advertising
    • blogging
    • bookmarks
    • events
    • messaging
    • music
    • news
    • photos
    • video
    • weather
  28. MASHUPS
    • work you don’t have to do
    • novel UI or application
    • enhance data
    • combine multiple data sources
    MASHUPS API API local data
  29. MASHUP EXAMPLES
    • work you don’t have to do
  30. MAAAAAAAAAAAPS!
    • Chicagocrime http://www.chicagocrime.org/
    • Overplot http://persistent.info/overplot/
    • Banned Books http://www.applefritter.com/bannedbooks/
    • Transit Map http://www.brail.org/transit/nycgoogle.html
    • World of Warcraft http://mapwow.com/
  31.  
  32.  
  33.  
  34.  
  35.  
  36. IT’S NOT ALL MAPS
    • TagTV http://www.onflex.org/TagTV/
    • Viral Video http://www.viralvideochart.com/
    • Blueorganizer http://www.adaptiveblue.com/
    • Salesforce AdWords http://www.salesforce.com/google/
  37.  
  38.  
  39.  
  40.  
  41. BLOWING MY OWN HORN
    • FlickrSVG
    • Familiar Faces
    • Web Connections
  42.  
  43. HOW DO I USE AN API?
    • work you don’t have to do
  44. TYPES OF APIS
    • 2 general types:
      • Interfaces (maps)
      • Data (everything else)
  45. MAKING A MAP
    • <script type=&quot;text/javascript&quot; src=&quot;http://maps.google.com/maps?file=api&amp;v=2&amp;key=XXXX&quot;></script>
  46. MAKING A MAP
    • mapObject = new GMap2(document.getElementById(&quot;mapArea&quot;));
    • mapObject.setCenter(new GLatLng(-27.059126, 132.791016), 3);
    • var userPoint = new GLatLng(-37.851543, 145.011978);
    • var mapMarker = new GMarker(userPoint);
    • mapObject.addOverlay(mapMarker);
  47. MAKING A MAP
  48. XML
    • using REST architecture, simply make an HTTP request to a resource on the server
      • curl()
      • wget()
    • returns XML
    • you do whatever you want with it!
  49.  
  50. XML + JavaScript
    • AJAX: Use XMLHttpRequest()
  51. X ML + JavaScript
    • AJA X : Use X MLHttpRequest()
  52. LIMITATIONS & CHALLENGES
    • work you don’t have to do
  53. LIMITATIONS OF APIS
    • restricted to what the provider makes available
      • screen scraping
    • query size/quantity
    • privacy concerns with automation
  54. API LOCK-IN
    • APIs change
      • license no longer appropriate
      • terms of use change
      • can you keep up?
  55. API LOCK-IN
    • APIs change
      • license no longer appropriate
      • terms of use change
      • can you keep up?
    • API standards
    • meta-APIs
      • Mapstraction
  56. CROSS-DOMAIN AJAX
    • same domain policy
    • can load
      • images
      • CSS
      • JavaScript
    • but not HTML/XML
      • browsers designed to protect “content”
    A
  57. WORKAROUNDS
    • server proxy
      • slow if not cached
      • bottleneck
    server
  58. WORKAROUNDS
    • server proxy
      • slow if not cached
      • bottleneck
    • JSON-P
      • no POST
      • fails silently
      • security risk
    { name1: value1, name2: value2, … } <script>
  59. WORKAROUNDS
    • server proxy
      • slow if not cached
      • bottleneck
    • JSON-P
      • no POST
      • fails silently
      • security risk
    callback( { name1: value1, name2: value2, … } ); ?f=callback <script>
  60. WORKAROUNDS
    • server proxy
      • slow if not cached
      • bottleneck
    • JSON-P
      • no POST
      • fails silently
      • security risk
    • Flash
      • it’s Flash
    Flash crossdomain.xml
  61. THE FUTURE
    • ContextAgnosticXmlHttpRequest
    • no HTTP authentication
    • no cookies
    • and/or
    • cross-domain policy file (like Flash)
    • and/or
    • HTTP header: X-Allow-Foreign-Hosts
    • limited cross-domain XMLHttpRequest
    • enhanced JSON
    • JSONRequest
    • like XHR, but execute JavaScript response
    • allows POST requests
    • provides status/error info
    • and/or
    • HTTP header: X-Allow-Foreign-Hosts
  62. DO SOMETHING!
    • open your data
      • trust
      • let others do the work
    • offer an API
      • microformats
      • XML
      • JSON-P
    • get involved
      • W3C Web API WG
  63. QUESTIONS?
    • work you don’t have to do
    Kevin Yank www.sitepoint.com Cameron Adams www.themaninblue.com

+ webdirectionswebdirections, 4 years ago

custom

5432 views, 15 favs, 4 embeds more stats

Adding JavaScript to your portfolio used to mean mo more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 5432
    • 5400 on SlideShare
    • 32 from embeds
  • Comments 2
  • Favorites 15
  • Downloads 0
Most viewed embeds
  • 28 views on http://www.webdirections.org
  • 2 views on http://joseanpg.net
  • 1 views on http://www.slideshare.net
  • 1 views on http://surf.googlemashups.com

more

All embeds
  • 28 views on http://www.webdirections.org
  • 2 views on http://joseanpg.net
  • 1 views on http://www.slideshare.net
  • 1 views on http://surf.googlemashups.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories