Mashups! - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

Mashups!

Description:

Mashups! Presented by Zhao Jin Outline What is a Mashup? How to build a Mashup? Demonstration References and Resources What is a Mashup? (Music) A musical genre which ... – PowerPoint PPT presentation

Number of Views:278
Avg rating:3.0/5.0
Slides: 30
Provided by: g0601
Category:
Tags: language | mashups | sign

less

Transcript and Presenter's Notes

Title: Mashups!


1
Mashups!
  • Presented by Zhao Jin

2
Outline
  • What is a Mashup?
  • How to build a Mashup?
  • Demonstration
  • References and Resources

3
What is a Mashup?
  • (Music) A musical genre which combines the layers
    of music from different songs
  • (Computing) A website or web application which
    combines contents from different websites

4
A Simple Example
User
What are the available flats near NUS?
Map with available flats marked
Mashup website
Request for available flat list
Request for area map
Area map
Flat list
Google Map
Real estate website
5
Pros and Cons
  • Pros
  • Information reuse
  • More resources to play with
  • Cons
  • Network congestion
  • Speed bottleneck
  • Danger of service failure

6
How to build a Mashup?
  • Prerequisites
  • Three steps
  • Planning
  • API sign-up
  • Coding

7
Prerequisites
  • Required
  • Programming Language
  • Web Programming
  • XML Manipulation (XPath, XQuery, etc)
  • Recommended
  • Web authoring tools

8
Planning
  • Pick a subject
  • A Mashup of What?
  • Map Real Estate?
  • Bookshop Library Catalog?
  • More sources of data ? More complicated
  • Decide your data sources
  • Who is your data provider?
  • Maps Google maps, Yahoo maps, etc..
  • Online shopping Amazon, EBay, etc..
  • Usually language agnostic
  • Varying complexity

9
Planning
  • Other concerns
  • How much time do you have?
  • Do you have a server to run it on?
  • Which programming language?

10
API Sign-up
  • Sign-up for the API
  • Visit the homepage of your data source and sign
    up
  • Example http//www.google.com/apis/maps/

11
Coding The big picture
User
User Request
Data presentation
Mashup website
Data Manipulation
Data
API Call
Data
API Call
Website 2
Website 1
12
Coding The steps
  • API Call
  • Data Manipulation
  • Web programming

13
API Call
  • Types of API How to call?
  • REST
  • XML-PRC
  • SOAP
  • Javascript
  • Functions of API What to call?
  • API specific

14
Types of API - REST
  • Request in HTTP and Response in XML
  • Example Google Geocoder
  • http//maps.google.com/maps/geo?
  • q The address that you want to geocode
  • Key Your API key
  • Output The output format
  • Sample request
  • http//maps.google.com/maps/geo?q1600amphitheare
    mtnviewcakeyoutputxml

15
Types of API - REST
  • Sample response
  • ltxmlgt
  • ltPlacemarkgt
  • ltaddressgt
  • 1600 Amphitheatre Pkwy, Mountain View, CA
    94043, USA
  • lt/addressgt
  • ltPointgt
  • ltcoordinatesgt-122.083739,37.423021,0lt/coordinate
    sgt
  • lt/Pointgt
  • lt/Placemarkgt
  • lt/xmlgt

16
Types of API XML-RPC
  • Request/Response in XML via HTTP
  • Example MSN Blogging API
  • XmlRpcClient in Apache
  • Sample Request
  • lt?xml version"1.0"?gt ltmethodCallgt
    ltmethodNamegtgetStateNamelt/methodNamegt
    ltparamsgt ltparamgtltvaluegtlti4gt4lt/i4gtlt/value
    gtlt/paramgt lt/paramsgt lt/methodCallgt

17
Types of API XML-RPC
  • Sample Response
  • lt?xml version"1.0"?gt ltmethodResponsegt
    ltparamsgt ltparamgt
    ltvaluegt ltstringgtSouth
    Dakotalt/stringgt lt/valuegt
    lt/paramgt lt/paramsgt lt/methodResponsegt

18
Types of APIs SOAP
  • Request/Reply in SOAP format via SMTP/HTTP
  • Example MSN Search API
  • HttpURLConnection in Java
  • Post the XML to the target URL
  • Sample request
  • ltsoapEnvelope xmlnssoapschemaURLgt ltsoapBodygt
    ltgetProductDetails xmlnstargetURLgt
    ltproductIDgt827635lt/productIDgt
    lt/getProductDetailsgt lt/soapBodygtlt/soapE
    nvelopegt

19
Types of APIs SOAP
  • Sample Response
  • ltsoapEnvelope xmlnssoapSchemaURLgt
  • ltsoapBodygt
  • ltgetProductDetailsResponse
    xmlnstargetURLgt
    ltgetProductDetailsResultgt
  • ltproductNamegtToptimatelt/produ
    ctNamegt ltproductIDgt827635lt/prod
    uctIDgt
  • ltpricegt96.50lt/pricegt
    lt/getProductDetailsResultgt
    lt/getProductDetailsResponsegt
    lt/soapBodygtlt/soapEnvelopegt

20
Types of APIs JavaScript
  • Request/Reply embedded in a stub object
  • XML not required unless data needed explicitly
  • Example Gogglemap
  • GMAP2 in Googlemap API
  • Var map new GMAP2(document.getElementById(map)
    )
  • map.setCenter(new GLatLng(37.4419,-122.1419),13))

21
Functions of API
  • API specific
  • Learn as needed

22
Data Manipulation
  • Purpose
  • To generate API requests
  • To process API responses
  • To represent data internally
  • Two components
  • Data schema
  • Tools for manipulation

23
Data schema (XML)
  • Define the schema for your data
  • What data do you want to store?
  • Entities and attributes
  • Good to be generic
  • Learn the schema of the APIs

24
Tools for manipulation
  • Basic level
  • Parser, Modifier, Writer
  • Available online
  • Higher level
  • Filter, Converter, Generator
  • Need to write on your own
  • Check out the tutorial for XPath, XQuery, etc.

25
Web Programming
  • Design UI for your page

26
Putting everything together
  • Your Mashup API calls Data Manipulation UI

User
User Request
Data presentation
Mashup website
Data Manipulation
Data
API Call
Data
API Call
Website 2
Website 1
27
Demonstration
  • Googlemap Craigslist Real Estate
  • http//www.housingmaps.com/
  • Amazon NLB catalog
  • http//www.bookjetty.com/

28
References and Resources
  • Reference
  • Wikipedia http//en.wikipedia.org/wiki/Mashup_(we
    b_application_hybrid)
  • Tutorial from IBM http//www-128.ibm.com/develope
    rworks/edu/x-dw-x-ultimashup1.html
  • Resources
  • List of Mashups, APIs http//www.programmableweb
    .com/http//www.webmashup.com/

29
References and Resources
  • Resources
  • APIs and Platforms
  • Amazon
  • http//www.amazon.com/gp/browse.html?node3
    435361
  • Googlemap http//www.google.com/apis/maps/
  • XPath, XQuery Tutorial
  • http//www.w3schools.com/xpath/
  • http//www.w3schools.com/xquery/default.asp
Write a Comment
User Comments (0)
About PowerShow.com