34
Constructing "SELECT * FROM Internet" Payment Tools Using the Yahoo! Query Language

Building Adaptive Payment Systems with YQL

Embed Size (px)

DESCRIPTION

Presentation on "Building Adaptive Payment Systems using YQL" presented at PayPal X Innovate 2010

Citation preview

Page 1: Building Adaptive Payment Systems with YQL

Constructing "SELECT * FROM Internet" Payment Tools Using the Yahoo! Query Language

Page 2: Building Adaptive Payment Systems with YQL

2

Page 3: Building Adaptive Payment Systems with YQL

1. Delivering Upsell Content from YQL Data Sources

2. Driving Traffic Back to Your Services with Open Data Tables

3. Mashing up Multiple Data Sources with Server-Side JavaScript

What We’ll Learn

3

Page 4: Building Adaptive Payment Systems with YQL

4

Page 5: Building Adaptive Payment Systems with YQL

5

Page 6: Building Adaptive Payment Systems with YQL

Making Queries SELECT * FROM Internet

6

Page 7: Building Adaptive Payment Systems with YQL

YQL Test Console

Available At: http://developer.yahoo.com/yql/console

7

Page 8: Building Adaptive Payment Systems with YQL

SELECT myColumn, myTitle FROM myTable(0, 50) WHERE myColumn = 'value' AND myTitle = 'title'

LIMIT 3 OFFSET 10 |

sort(field='myColumn') | reverse()

Running Queries - SELECT Query Structure

8

Page 9: Building Adaptive Payment Systems with YQL

Modify Data on the InternetCreate Tweets, Add Blog Entries, Update Databases

Current Tables Using I/U/DTwitter Status, bit.ly URL Shortner, Yahoo! Profile Status / Update Stream, Amazon SimpleDB

Running Queries - INSERT / UPDATE / DELETE

9

Page 10: Building Adaptive Payment Systems with YQL

SELECT * FROM flickr.photos.search WHERE (lat, lon) IN (SELECT centroid.latitude, centroid.longitude FROM geo.places WHERE text="SFO")

Running Queries – Sub-selects with the IN clause

10

Page 11: Building Adaptive Payment Systems with YQL

Running Queries – Available Tables

YQL Command: SHOW Tables

Number of Standard Tables: 169Number of Community Tables: 771Total Number of Tables: 940

Contribute Tables to: http://www.github.com/yql/yql-tables/

11

Page 12: Building Adaptive Payment Systems with YQL

Running Queries – Table Syntax

YQL Command: DESC tablename

12

Page 13: Building Adaptive Payment Systems with YQL

http://query.yahooapis.com/v1/yql?[params]http://query.yahooapis.com/v1/public/yql?[params]

Params• q=[QUERY]• format=[XML / JSON]• diagnostics=[true / false]• debug=[true / false]• callback=[function name]

Running Queries – URL Format

13

Page 14: Building Adaptive Payment Systems with YQL

http://query.yahooapis.com/v1/yql?[params]http://query.yahooapis.com/v1/public/yql?[params] Params• q=[QUERY]• format=[XML / JSON / JSONP / JSONP-X]• diagnostics=[true / false]• debug=[true / false] • callback=[function name]

Running Queries – URL Format

14

Page 15: Building Adaptive Payment Systems with YQL

15

Driving Traffic Back to your Services

Page 16: Building Adaptive Payment Systems with YQL

YQL Open Data Tables Wrap Your Own API or Data Source

16

Page 17: Building Adaptive Payment Systems with YQL

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta></meta> <bindings></bindings></table>

Open Data Tables – XML File Syntax

17

Page 18: Building Adaptive Payment Systems with YQL

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta></meta> <bindings></bindings></table>

Open Data Tables – XML File Syntax

18

Page 19: Building Adaptive Payment Systems with YQL

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta> <author>Jonathan LeBlanc</author> <description>My Table</description> <documentationURL>www.site.com</documentationURL> <sampleQuery>SELECT * FROM {table} </sampleQuery> </meta> <bindings></bindings></table>

Open Data Tables – XML File Syntax

19

Page 20: Building Adaptive Payment Systems with YQL

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta></meta> <bindings></bindings></table>

Open Data Tables – XML File Syntax

20

Page 21: Building Adaptive Payment Systems with YQL

<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta></meta> <bindings> <select itemPath="" produces="XML" > <urls> <url env="all”>http://www.site.com/{user}</url> </urls> <inputs> <key id="user" type="xs:string" paramType="path" required="true" /> </inputs> </select> </bindings></table>

Open Data Tables – XML File Syntax

21

Page 22: Building Adaptive Payment Systems with YQL

The USE clause

USE "http://alavilli.com/yql/paypal_txn_table.xml" AS paypal_txn_table;

SELECT * FROM paypal_txn_table WHERE StartDate="2010-06-12T00:00:00.000Z" AND APIUsername="xxx" AND APIPassword="xxx" AND Signature="xxx"

Open Data Tables – Invoking a Table Definition

22

Page 23: Building Adaptive Payment Systems with YQL

New PayPal Tables!

Available At: http://github.com/yql/yql-tablesTransaction Search: paypal/paypal.transaction.xml

Transaction Details: paypal/paypal.transactions.details

23

Page 24: Building Adaptive Payment Systems with YQL

24

Page 25: Building Adaptive Payment Systems with YQL

25

Mapping Social Data to Products

Location

Interests

Profession

Friends

Birthday / Anniversary

Regional Products

Product Suggestions

Specialty Merchandise

Suggest to Friends

Seasonal / Targeted Products

Page 26: Building Adaptive Payment Systems with YQL

YQL Execute Extending Open Data Tables

26

Page 27: Building Adaptive Payment Systems with YQL

Augment dataCollect geographic data based on a free-form text location

Create APIs from web pagesBuild your very own ScrAPI

Data TransformationsConvert the results from xml to Google's kml format

Move business logic of your application to the cloud

YQL Execute – XML File Syntax

27

Page 28: Building Adaptive Payment Systems with YQL

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta></meta> <bindings> <select itemPath="" produces="XML" > <urls></urls> <inputs></inputs> </select> </bindings></table>

YQL Execute – XML File Syntax

28

Page 29: Building Adaptive Payment Systems with YQL

<?xml version="1.0" encoding="UTF-8"?><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<meta></meta> <bindings> <select itemPath="" produces="XML" > <urls></urls> <inputs></inputs> <execute></execute> </select> </bindings></table>

YQL Execute – XML File Syntax

29

Page 30: Building Adaptive Payment Systems with YQL

<execute> <![CDATA[ var arrQueries = inputs['query'].split('|'); var elQueries = <queries/>; . . . ]]></execute>

YQL Execute – XML File Syntax

30

Page 31: Building Adaptive Payment Systems with YQL

Global Disaster Alert and Coordination System Table

Available At: http://github.com/yql/yql-tablesUnder gdacs/gdacs.current.xml

31

Page 32: Building Adaptive Payment Systems with YQL

Build adaptive applications faster (and that run faster)

Conclusion

32

Page 33: Building Adaptive Payment Systems with YQL

YQL Documentationhttp://developer.yahoo.com/yql

YQL Consolehttp://developer.yahoo.com/yql/console

YQL Github Account (Contribute Tables)http://github.com/yql/yql-tables

33

Page 34: Building Adaptive Payment Systems with YQL

Thank YouQuestions?

34