SlideShare a Scribd company logo
1 of 43
Download to read offline
Heavy Duty YUI 3 & YQL
Eric Ferraiuolo
@ericf
http://tiptheweb.org
Community-Supported
Web Publishing
http://www.flickr.com/photos/alper/4094452745/
Live Demo
YUI 3 at TipTheWeb
A Lot of YUI 3
56YUI 3 Modules
http://www.flickr.com/photos/curiousexpeditions/489992128/
Top-Level Components
• Manage interactions within page
• Extends Y.Base uses ATTRS, Custom Events
•Y.BaseComponentMgr
•Y.Resource
Component Management
• Y.Base extension
• Adds COMPONENTS to Y.Base, think ATTRS
• Dependencies & Instances on-demand
• this.useComponent('foo', callback);
Y.BaseComponentMgr Example
// Defined statically
COMPONENTS : {
! myOverlay : {
! ! requires : ['overlay', 'gallery-overlay-extras'],
! ! initializer : '_initMyOverlay'
! }
}
// …Somewhere else
Y.one('#show').on('click', Y.bind(function(e){
this.useComponent('myOverlay', function(overlay){
overlay.show();
});
}, this));
RESTful Client
• RESTful HTTP semantics
• JSON in, JSON out
• Resource-scoped Events
Y.Resource Example
var r = new Y.Resource({ uri: 'path/to/{id}' });
r.GET({! // makes request to: path/to/123
! params!: { id: 123 },
! on! : {
! ! success : function(e){
! !
! ! ! // e.entity is an Object parsed from JSON
! ! !
! ! }
! }
});
Lots of Overlays
Overlay Extras
• Y.Plugin.OverlayModal
• Y.Plugin.OverlayKeepaligned
• Y.Plugin.OverlayAutohide
YQL at TipTheWeb
URLs
• http://925html.com/code/photos-around-you/
• http://www.flickr.com/photos/37592789@N00/5095656356/
• http://www.flickr.com/photos/fwiltrakis/5095656356/
• http://www.youtube.com/watch?v=8410qUT4QtA
• http://bit.ly/Bb6g0
URL Processing — Targeting Tips
Example: http://bit.ly/Bb6g0
1.Determine Integration, If Any
2.Gather URL Data
3.Cache & Return Results
SELECT * FROM targetresolver
WHERE url="http://bit.ly/Bb6g0"
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
No, Request Page
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
No, Request Page
SELECT url FROM docresolver
WHERE url="http://bit.ly/Bb6g0"
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
Redirected?
No, Request Page
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
Redirected?
No, Request Page
Yes, http://www.youtube.com/watch?v=8410qUT4QtA
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
Redirected?
No, Request Page
Yes, http://www.youtube.com/watch?v=8410qUT4QtA
youtube.com Matches?
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
Redirected?
No, Request Page
Yes, http://www.youtube.com/watch?v=8410qUT4QtA
youtube.com Matches?
Yes, Load Integration
Determine Integration, If Any
http://bit.ly/Bb6g0
bit.ly Matches?
Redirected?
No, Request Page
Yes, http://www.youtube.com/watch?v=8410qUT4QtA
youtube.com Matches?
Yes, Load Integration
y.include("store://youtube.js");
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Yes, 8410qUT4QtA
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Is YouTube Video?
Yes, 8410qUT4QtA
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Is YouTube Video?
Yes, 8410qUT4QtA
SELECT title, author FROM youtube.videos
where id="8410qUT4QtA"
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Is YouTube Video?
Yes, 8410qUT4QtA
Yes, Valid YouTube Video
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Is YouTube Video?
Yes, 8410qUT4QtA
Yes, Valid YouTube Video
Gather Video MetaData
Gather URL Data
http://www.youtube.com/watch?v=8410qUT4QtA
Matches Video URL?
Is YouTube Video?
Yes, 8410qUT4QtA
Yes, Valid YouTube Video
Gather Video MetaData
{
"author": "…",
"title": "…"
}
• Cache Result for 1 hour
• Return Target Data:
Cache & Return Results
{
! "link"! : "http://www.youtube.com/watch?
v=8410qUT4QtA",
! "title"!: "Chicken Techno by Oli Chang",
! "target": "youtube:unicornhunters"
}
Requests Made By YQL
1.Requested: http://bit.ly/Bb6g0
2.Redirected: http://www.youtube.com/
watch?v=8410qUT4QtA
3.Included: store://youtube.js
4.Requested: Google GData Video Feed
YQL via the Browser
• Thick-clients can do real work
• Off-load YQL requests
• Rate limits become a non-issue
• Server’s resources freed-up
YQL via YUI 3
• Spread load and rate limits to browsers
• Guinea pig for Dav Glass’ YQL module for YUI
• Y.YQL(query, callback);
Y.YQL('SELECT * FROM targetresolver WHERE url="…"',
! function(r) {
!
! var results = r.query.results;
!
});
http://www.flickr.com/photos/monkeyc/231565309/
• Cached results are not rate limited!
• ?_maxage=3600
• response.maxAge=3600;
Caching
Timeout
• Preventing table lock!
• request.timeout(25000);
• y.rest(url).timeout(25000);
• y.query(query, params, 25000);
timer.getRemaining()
timer = (function(){
! timeout = timeout > 29000 ? 29000 : timeout;
! var start = new Date().getTime();
!
! return {
! ! getRemaining : function () {
! ! ! var now = new Date().getTime(),
! ! ! ! elapsed = now - start,
! ! ! ! remaining = timeout - elapsed;
! ! ! !
! ! ! return ( remaining > 0 ? remaining : 0 );
! ! }
! };
}());
Summary
• YUI 3 & YQL— enabling small teams
• YUI 3 top-level components
• YQL— cache, timeout, access via browser
Invite Code: yuiconf
Eric Ferraiuolo
@ericf
http://tiptheweb.org

More Related Content

Similar to TipTheWeb.org - Heavy Duty YUI 3 & YQL

YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012Saurabh Sahni
 
YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...
YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...
YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...Jarek Wilkiewicz
 
Essential digital resources (2011 version)
Essential digital resources (2011 version)Essential digital resources (2011 version)
Essential digital resources (2011 version)Danny Nicholson
 
YQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentationYQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentationKorben00
 
YQL & Yahoo! APIs - Open Hack India 2011
YQL & Yahoo! APIs - Open Hack India 2011YQL & Yahoo! APIs - Open Hack India 2011
YQL & Yahoo! APIs - Open Hack India 2011Saurabh Sahni
 
C___oop_to_Advanced zarif.pptx
C___oop_to_Advanced zarif.pptxC___oop_to_Advanced zarif.pptx
C___oop_to_Advanced zarif.pptxShafiqUllah27
 
Query the web with YQL
Query the web with YQLQuery the web with YQL
Query the web with YQLramace
 
Video Archiving and Playback in the Wayback Machine
Video Archiving and Playback in the Wayback MachineVideo Archiving and Playback in the Wayback Machine
Video Archiving and Playback in the Wayback MachineSawood Alam
 
Building Video Applications with YouTube APIs
Building Video Applications with YouTube APIsBuilding Video Applications with YouTube APIs
Building Video Applications with YouTube APIsJarek Wilkiewicz
 
Search 500-video-clips
Search 500-video-clipsSearch 500-video-clips
Search 500-video-clipsphanhung20
 
Creating custom modules using YUI3
Creating custom modules using YUI3Creating custom modules using YUI3
Creating custom modules using YUI3Gonzalo Cordero
 
Open Hack London - Introduction to YQL
Open Hack London - Introduction to YQLOpen Hack London - Introduction to YQL
Open Hack London - Introduction to YQLChristian Heilmann
 

Similar to TipTheWeb.org - Heavy Duty YUI 3 & YQL (20)

YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
YQL: Hacking on steroids - Yahoo! Open Hack Day 2012
 
YQL & Yahoo! Apis
YQL & Yahoo! ApisYQL & Yahoo! Apis
YQL & Yahoo! Apis
 
YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...
YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...
YouTube APIs presentation at Facultad de Ciencias, Universidad Nacional Autón...
 
YQL - HackU IIT Madras 2012
YQL - HackU IIT Madras 2012YQL - HackU IIT Madras 2012
YQL - HackU IIT Madras 2012
 
Yql hacku iitd_2012
Yql hacku iitd_2012Yql hacku iitd_2012
Yql hacku iitd_2012
 
Essential digital resources (2011 version)
Essential digital resources (2011 version)Essential digital resources (2011 version)
Essential digital resources (2011 version)
 
Yql with geo
Yql with geoYql with geo
Yql with geo
 
YQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentationYQL - Christian Heilmann Open Hack London presentation
YQL - Christian Heilmann Open Hack London presentation
 
Web services and JavaScript
Web services and JavaScriptWeb services and JavaScript
Web services and JavaScript
 
YQL & Yahoo! APIs - Open Hack India 2011
YQL & Yahoo! APIs - Open Hack India 2011YQL & Yahoo! APIs - Open Hack India 2011
YQL & Yahoo! APIs - Open Hack India 2011
 
C___oop_to_Advanced zarif.pptx
C___oop_to_Advanced zarif.pptxC___oop_to_Advanced zarif.pptx
C___oop_to_Advanced zarif.pptx
 
Query the web with YQL
Query the web with YQLQuery the web with YQL
Query the web with YQL
 
Video Archiving and Playback in the Wayback Machine
Video Archiving and Playback in the Wayback MachineVideo Archiving and Playback in the Wayback Machine
Video Archiving and Playback in the Wayback Machine
 
Building Video Applications with YouTube APIs
Building Video Applications with YouTube APIsBuilding Video Applications with YouTube APIs
Building Video Applications with YouTube APIs
 
Search 500-video-clips
Search 500-video-clipsSearch 500-video-clips
Search 500-video-clips
 
Creating custom modules using YUI3
Creating custom modules using YUI3Creating custom modules using YUI3
Creating custom modules using YUI3
 
Open Hack London - Introduction to YQL
Open Hack London - Introduction to YQLOpen Hack London - Introduction to YQL
Open Hack London - Introduction to YQL
 
Technology Tips for Administrators
Technology Tips for AdministratorsTechnology Tips for Administrators
Technology Tips for Administrators
 
Embedded Videos: from Invisibility to Visibility
Embedded Videos: from Invisibility to VisibilityEmbedded Videos: from Invisibility to Visibility
Embedded Videos: from Invisibility to Visibility
 
Masal 2010 b&b - v13
Masal 2010   b&b - v13Masal 2010   b&b - v13
Masal 2010 b&b - v13
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

TipTheWeb.org - Heavy Duty YUI 3 & YQL