Stealing Google Logos using Yahoo API
Many love browsing through Google Logos, so do some of my friends, was planning to make a simple page with infinite scroll with all the Google Doodles so far.
The idea
To programmatically fetch all Google logos so far and display it with infinite scroll, also to keep the page in sync with Google logo list.
The plan
Using Yahoo! YQL to select the required section from the Google logo page and display the images suitably. As YQL also returns a JSON, displaying the required images was not a big issue.
The key ingredients : Yahoo! YQL + Jquery
The recipe :
Fetching images :
0. Set query for YQL.
1. $.getJSON() and parse the required data.
2. Append the img's to a div.
Infinite Scroll :
0. Get the document height.
1. Set pageoffset.
2. Using $(window).scroll() method, set the new pageoffset.
3. Based on the id of the last img loaded, load more images.
Limitations :
# Per application limit (identified by your Access Key): 100,000 calls per day.
# Per IP limits: /v1/public/*: 1,000 calls per hour; /v1/yql/*: 10,000 calls per hour.
DEMO!
Recent blog posts
- TypeError: Object #<NodeList> has no method 'forEach' in javascript?
- JSON parsing with ruby one-liner ?
- Native JS like jQuery
- URL scrapping with javascript
- Download images with node.js
- TypeError: can't convert Regexp into String
- One click duckduckgo
- Comparing Strings with variable white spacing
- Watir Webdriver attach window
- Remotely enable remote desktop on Debian