Building With YQL And YUI

YQL
and
YUIBuilding
blocks
for
quick
applica8onsChris8an
Heilmann,
Yahoo
internal
talk,
Sunnyvale,
California,
02/02/2010

I
am
known
to
be
able
to
quickly
build
cool
demos.

hIp://keywordfinder.org/

hIp://isithackday.com/hacks/guardian/

hIp://icant.co.uk/geomaker/index.php

hIp://github.com/codepo8/QuickTrans

hIp://icant.co.uk/goohoobi/index.php?research

hIp://uk‐house‐prices.com/

The
reason
is
that
I
am
building
with
things
that
 work.

And
that
gives
me
8me
to
concentrate
on
the
 important
things.

One
thing
I
am
bored
of
is
wri8ng
CSS
layouts.


Which
is
why
I
am
using
a
very
simple
solu8on.

hIp://developer.yahoo.com/yui/grids/builder/

hIp://developer.yahoo.com/yui/grids/builder/

The
reason
is
that
I
want
to
support
browsers
‐
not
work for
them.

I’d
rather
be
able
to
update
a
CSS
URI
than
re‐write
my
CSS
when
a
new
browser
comes
around.

Things
we
spend
far
too
much
8me
on:Hacks
to
make
browsers
work.Op8mising
prematurely.Using
our
pet
language/environment/libraryReading
badly
wriIen
tutorials
and
incomplete
documenta8on.Using
bleeding
edge
effects
and
interfaces
and
then
trying
to
create
a
fallback
solu8on.Flashy
effects.

What
we
really
should
start
with
is
the
data.

This
is
where
APIs
and
web
services
come
in.

The
issue
is
that
all
of
these
are
wriIen
differently,
expect
different

authen8ca8on
and
give
back
different
data.

YQL



hIp://developer.yahoo.com/yql/console/

YQL



hIp://developer.yahoo.com/yql/console/select
{what}
from
{where}
where
{condi8ons}

hIp://isithackday.com/hacks/frankfurt

A
few
examples...select
*
from
flickr.photos.search
where
text="donkey"

A
few
examples...select
*
from
flickr.photos.search
where
text="donkey"
and
license=4

A
few
examples...select
*
from
craigslist.search
where
loca8on="s`ay"
and
type="sss"
and
query="flower
pot"

A
few
examples...select
*
from
google.news
where
q="healthcare"

A
few
examples...select
*
from
query.mul8
where
queries
in
('select
*
from
nyt.ar8cle.search
where
query="healthcare"','select
*
from
microsoc.bing.news
where
query="healthcare"','select
*
from
google.news
where
q="healthcare"')

A
few
examples...select
content
from
html
where
url="hIp://www.foxnews.com/"
and
xpath="//h2/a"

A
few
examples...select
*
from
google.translate
where
q
in
(select
content
from
html
where
url="hIp://www.foxnews.com/"
and
xpath="//h2/a")
and
target="fr"

A
few
examples...insert
into
wordpress.post
(8tle,
descrip8on,
blogurl,
username,
password)
values
("Test
Title",
"This
is
a
test
body",
"hIp://yqltest.wordpress.com",
"yqltest",
"password")

Using
YQL
has
a
lot
of
benefits:No
8me
wasted
reading
API
docsUsing
the
console
makes
crea8ng
complex
queries
dead
easy.Data
filtering
down
to
the
least
amount
necessary. Fast
pipes. Caching
+
conver8ng
Server‐side
JavaScript


Using
YQL
is
easy!
(PHP)

Using
YQL
is
easy!
(JavaScript)

What
I
tend
to
do
with
YQL
is
build
APIs
that
render
out
HTML.

The
reason:
re‐use.


An
“API”
like
this
allows
you
to
build
a
non‐script
version
and
re‐use
it
with
Ajax
for
a
slicker
 experience.


Furthermore,
you
can
offer
it
to
the
outside
world
later
:)

And
to
build
the
interface,
I
use
libraries.

Libraries. (...)

NESS A D H E 
M OP 
T ST

Build
interfaces
that
work!

hIp://icant.co.uk/csscharts/

hIp://uk‐house‐prices.com/graphs.php?bloc=230&bstart=50&bend=54&start=50&end=54&loc=230

hIp://developer.yahoo.com/yui/ar8cles/hos8ng/#configure

hIp://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array.html

hIp://developer.yahoo.com/yui/examples/slider/slider_dual_with_highlight.html

Preview
8me!

Kids
these
days...hIp://www.flickr.com/photos/jamin2/3851031112/hIp://www.flickr.com/photos/codepo8/311805104/

By
using
out‐of‐the‐box
solu8ons
and
keeping
a
pragma8c
mind
you
can
quickly
build
something.

And
if
that
is
not
crea8ve
enough
for
you,
you
could
help
improving
the
libraries
that
enable
others
to
do
so.

Only
by
using,
tes8ng
and
improving
we
can
build
beIer
solu8ons.

So,
give
the
things
I
showed
a
go,
and
feed
back
to
us
what
needs
improvement!


Chris8an
Heilmann
hIp://wait‐8ll‐i.com
 Thanks!
hIp://developer‐evangelism.com
hIp://twiIer.com/codepo8




Jump directly to slide:

    Easy Slideshare by Christian Heilmann, licensed with BSD License.