Select * from internet

71

description

 

Transcript of Select * from internet

Page 1: Select * from internet
Page 2: Select * from internet

Select * from Internet

Markandey Singh

Page 3: Select * from internet

http://bit.ly/yqlagency

Page 4: Select * from internet

$ Hello!

Page 5: Select * from internet

$ whoami@markandey

Page 6: Select * from internet

I work @

Yahoo!

Page 7: Select * from internet

I am a {JavaScript}

Hacker

Page 8: Select * from internet

Advertising on web is not same as on paper.

Page 9: Select * from internet

On web, Ads Have power of HTML5.

Page 10: Select * from internet

To make great (html5 app)

Ads

Page 11: Select * from internet

shift your point of view

Page 12: Select * from internet

From Ad to data

Page 13: Select * from internet

From Ad to data

Page 14: Select * from internet

Ad is not start

Page 15: Select * from internet

Ad comes at the end and need most of

the work

Page 16: Select * from internet

What you start

with is information

and a goal

Page 17: Select * from internet

What you start

with is 1nf0rmat10nand a goal

Page 18: Select * from internet

On Webinformation is not always structured

Page 19: Select * from internet

YQL makes easy to access

unstructured data

Page 20: Select * from internet

YQLis

Yahoo! Query Language

Page 21: Select * from internet

YQLis

Yahoo! Query Languageand its not a language

of its own.

Page 22: Select * from internet

YQLis a

web service which works on SQL like syntax

Page 23: Select * from internet

YQL lets you access data from Yahoo!

Page 24: Select * from internet

YQL lets you access data from Yahoo!

& rest of web

Page 25: Select * from internet

Select {What} from {service} where {condition};

Page 26: Select * from internet

For example

Page 27: Select * from internet

select * from flickr.photos.search where

text=”Delhi" and api_key='2149834c0fb3e9e84de9c3

1d50c7a97d'

Page 28: Select * from internet

Lets start with YQL console

Page 29: Select * from internet

SELECT A TABLE

Page 30: Select * from internet

SEE QUERY HERE

Page 31: Select * from internet

OUTPUT

Page 32: Select * from internet

TAKE AWAY QUERY URL

Page 33: Select * from internet

URL Output

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

<xml>

</xml

{ ‘json’:’json’ }

Page 34: Select * from internet

Lets see with example

Page 35: Select * from internet

select * from flickr.photos.interestingness

Page 36: Select * from internet

Here is the code

Page 37: Select * from internet

JSON

{ “photo”: “xyzphr”, “user”: “phfhfb”}

Page 38: Select * from internet

JSON with callback

foo ({ “photo”: “xyzphr”, “user”: “phfhfb”});

Page 39: Select * from internet

This is what you get

http://bit.ly/yqlflickr

Page 40: Select * from internet

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

YQL With PHP

Page 41: Select * from internet

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 42: Select * from internet

Page Scraping

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

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

Page 43: Select * from internet

Delhi FM Radio

Page 44: Select * from internet
Page 45: Select * from internet

select * from html where url=“http://www.radiomirchi.com/delhi" and xpath=“…”;

URL

Page 46: Select * from internet

select * from html where url=“http://www.radiomirchi.com/delhi" and xpath=“//marquee[@id="ticker_nowplaying"]”;

XPATH

Page 47: Select * from internet

You can search currently playing song

on youtube

select * from youtube.search where query="currently playing song”

Page 48: Select * from internet

Can you think of a hack???

+

Page 49: Select * from internet

This is what You get

http://bit.ly/yqlmirchi

Page 50: Select * from internet

ChromYQLipchromy-clip

bit.ly/yqlhtml

Page 51: Select * from internet

Content Analysis with YQL

bit.ly/yqlcap

Page 52: Select * from internet

One catch with CAP

Page 53: Select * from internet

One catch with CAP

URL length is limited , so you have to switch back to POST, method on YQL.

Page 54: Select * from internet

Lets see some more hacks

Page 55: Select * from internet

Picture me

bit.ly/pikme

Page 56: Select * from internet

What else YQL can do????

Page 57: Select * from internet

You can create your own table

Read more bit.ly/yqlODT

Page 58: Select * from internet

My random hello!! table

Page 59: Select * from internet

You can store secrets on YQL

Page 60: Select * from internet

60

Twitter oauthSELECT * FROM twitter.STATUS.timeline.friendsWHERE oauth_consumer_key = '9DiJt6Faw0Dyr61tVOATA'AND oauth_consumer_secret = 'XBF9j0B2SZAOWg44QTu6fCwYy5JtivoNNpvJMs6cA'AND oauth_token = '18342542-NkgUoRinvdJVILEwCUQJ3sL2CIm2ZwzS5jjj2Lg7y'AND oauth_token_secret = 'D6ewAzsueTzQmrAJGFH0phV5zgWT88FOtcMeqW4YeI';

YQL

Local storage

oauth_token

oauth_token

oauth_consumer_key

oauth_consumer_secret

Page 61: Select * from internet

Read more here

http://bit.ly/yqloauth

Page 62: Select * from internet

Placemaker: geo this

Page 63: Select * from internet

You Can Also Access Google

Spreadsheet via YQL

Page 64: Select * from internet

You need to publish spreadsheet to the web

Page 65: Select * from internet

You need to publish spreadsheet to the web

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

Page 66: Select * from internet

You need to publish spreadsheet to the web

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

Page 67: Select * from internet

You need to publish spreadsheet to the web

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

select * from csv where url=’….'

Page 68: Select * from internet

Google Spreadsheetswrite-protected can have specific access.

Page 69: Select * from internet

More Hacks here

http://bit.ly/markhack

Page 70: Select * from internet

Siri vs fake

http://bit.ly/sirichrome

Page 71: Select * from internet

Reach me

twitter@markandey

http://bit.ly/yqlflickrhttp://bit.ly/yqlmirchihttp://bit.ly/yqlhtmlhttp://bit.ly/yqlcaphttp://bit.ly/pikmehttp://bit.ly/yqlODThttp://bit.ly/yqloauthhttp://bit.ly/markhackhttp://bit.ly/sirichrome