yql: master of the mix

74
YQL: Master of Mix

Upload: markandey

Post on 22-May-2015

1.596 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: YQL: Master Of the Mix

YQL: Master of Mix

Page 2: YQL: Master Of the Mix

Hello!!IIT Madras

Page 3: YQL: Master Of the Mix
Page 4: YQL: Master Of the Mix

Mixing is amazing!!

Page 5: YQL: Master Of the Mix

Mix Chemicals

Page 6: YQL: Master Of the Mix

Classic result of mixing

Page 7: YQL: Master Of the Mix

Classic result of mixing

Steel

Page 8: YQL: Master Of the Mix

Mix Drinks

Page 9: YQL: Master Of the Mix

Mix Music

Page 10: YQL: Master Of the Mix

DATA

Page 11: YQL: Master Of the Mix

DATA

Page 12: YQL: Master Of the Mix

I am Markandey Singh{JavaScript Hacker}

I work at Yahoo!

Page 13: YQL: Master Of the Mix

YQL is Fun….

Page 14: YQL: Master Of the Mix

YQL is Yahoo! Query Language

Page 15: YQL: Master Of the Mix

YQL is a

web service which works on SQL like syntax

Page 16: YQL: Master Of the Mix

On Webinformation is not structured

Page 17: YQL: Master Of the Mix

YQL makes easy to access unstructured

data

Page 18: YQL: Master Of the Mix

THIS IS YQL CONSOLE

Page 19: YQL: Master Of the Mix

SELECT A TABLE

Page 20: YQL: Master Of the Mix

SEE QUERY HERE

Page 21: YQL: Master Of the Mix

OUTPUT

Page 22: YQL: Master Of the Mix

TAKE AWAY QUERY URL

Page 23: YQL: Master Of the Mix

URL output

http://query.yahooapis.com/{query}

Page 24: YQL: Master Of the Mix

URL output

http://query.yahooapis.com/{query}

<xml>

</xml>

Page 25: YQL: Master Of the Mix

URL output

http://query.yahooapis.com/{query}

<xml>

</xml>

{ “json”:”json”}

Page 26: YQL: Master Of the Mix

JSON

{ “name”: “markandey”}

Page 27: YQL: Master Of the Mix

JSON with callback

foo ({ “name”: “markandey”});

Page 28: YQL: Master Of the Mix

YQL Console Demo

Page 29: YQL: Master Of the Mix

Lets see with example

Page 30: YQL: Master Of the Mix

Select * from

interestingness

Page 31: YQL: Master Of the Mix

select * from flickr.photos.interestingness(20) where api_key='0fbb2b721757f77a6a9d038f4649a2b'

Page 32: YQL: Master Of the Mix

select * from flickr.photos.interestingness(20) where api_key='0fbb2b721757f77a6a9d038f4649a2b'

Page 33: YQL: Master Of the Mix

<img src=“//farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg“>

select * from flickr.photos.interestingness(20) where api_key='0fbb2b721757f77a6a9d038f4649a2b'

Page 34: YQL: Master Of the Mix

Here is the code

Page 35: YQL: Master Of the Mix

This is what you get

http://bit.ly/yqlflickr

Page 36: YQL: Master Of the Mix

Flickr Demo

Page 37: YQL: Master Of the Mix

$session = curl_init($yql_query_url); curl_setopt($session, CURLOPT_RETURNTRANSFER,true); $json = curl_exec($session);

YQL With PHP

Page 38: YQL: Master Of the Mix

YUI().use('yql', function(Y) {

Y.YQL('select * from weather.forecast where location=90210', function(r) { //r now contains the result of the YQL Query //use the YQL Developer console to learn //what data is coming back in this object //and how that data is structured. });

});

YQL With YUI

Page 39: YQL: Master Of the Mix

YQL has many Yahoo! and non-yahoo tables

Page 40: YQL: Master Of the Mix

Page Scraping

Page 41: YQL: Master Of the Mix

Page Scraping URL

Page 42: YQL: Master Of the Mix

Page Scraping URL

XPATH

Page 43: YQL: Master Of the Mix

Page Scraping

select * from html where url=“------"

and xpath=“--------”;

Page 44: YQL: Master Of the Mix

Your site!!

Page 45: YQL: Master Of the Mix

select * from html where url=“http://www.iitm.ac.in/csdept"

and xpath=“……..”;

URL

Page 46: YQL: Master Of the Mix

select * from html where url=“http://www.iitm.ac.in/csdept"

and

xpath=“//div[@id="content"]/div/table[3]”;

XPATH

Page 47: YQL: Master Of the Mix

ChromYQLipchromy-clip

Page 48: YQL: Master Of the Mix

YQL console demoPage scraping

Page 49: YQL: Master Of the Mix

This is what You get

http://bit.ly/searchiitm

Page 50: YQL: Master Of the Mix

Search demo

Page 51: YQL: Master Of the Mix

Content Analysis with YQL

http://bit.ly/yqlcap

Page 52: YQL: Master Of the Mix

Picture me

http://bit.ly/pikme

Page 53: YQL: Master Of the Mix

What else YQL can do????

Page 54: YQL: Master Of the Mix

You can create your own table

Read more bit.ly/yqlODT

Page 55: YQL: Master Of the Mix

My random hello!! table

Page 56: YQL: Master Of the Mix

Table Demo

Page 57: YQL: Master Of the Mix

Store Secret on YQL

YQL hosted storage

insert into yql.storage.admin

(name, value) values (“value-name”,”value")

Page 58: YQL: Master Of the Mix

Store Secret on YQL

YQL hosted storage

Page 59: YQL: Master Of the Mix

Store Secret on YQL

YQL hosted storage

execute select update

Page 60: YQL: Master Of the Mix

Keys Demo

Page 61: YQL: Master Of the Mix
Page 62: YQL: Master Of the Mix

You Can Also Access Google Spreadsheet

via YQL

Page 63: YQL: Master Of the Mix

You need to publish spreadsheet to the web

Page 64: YQL: Master Of the Mix

You need to publish spreadsheet to the web

https://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=html

Page 65: YQL: Master Of the Mix

You need to publish spreadsheet to the web

https://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=CSV

Page 66: YQL: Master Of the Mix

You need to publish spreadsheet to the web

https://docs.google.com/spreadsheet/pub?key=0AgGxPO1AxEhldFZDNzAzQldLSGp2MzVGVXdlUnIxeUE&output=CSV

select * from csv where url=’….'

Page 67: YQL: Master Of the Mix

Siri vs fake

Page 68: YQL: Master Of the Mix

Siri Demo

Page 69: YQL: Master Of the Mix

2 More Things

Page 70: YQL: Master Of the Mix

Foo

http://bit.ly/foocode

Page 71: YQL: Master Of the Mix

Foo Demo

Page 72: YQL: Master Of the Mix

CodeFoo plugin for Sublime Text 2

http://bit.ly/codefoo2

Page 73: YQL: Master Of the Mix

Codefoo demo

Page 74: YQL: Master Of the Mix

Reach me

@markandey