Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Wrapper to store YQL results in localstorage when the browser supports it

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 README
Octocat-spinner-32 yqlcache.js
README
A simple wrapper for YQL to support local storage.

Use like this:

yqlcache.get({
  yql: 'select * from flickr.photos.search where text="warsaw"',
  id: 'myphotos',
  cacheage: ( 60*60*1000 ),
  callback: function(data) {
    console.log(data);
  }
});

yql - the YQL statement
id - the storage key for localstorage
cacheage - how long to store the data
callback - function to call when the data is retrieved

The returned data in the callback is an object with two properties:

data - the YQL data 
type - the type of data - either 'cached' for cached data, 'freshcache' 
       for newly cached information or 'live' when caching is not available.


Something went wrong with that request. Please try again.