https://github.com/thinkphp/yqlcache
Wrapper to store YQL results in localStorage when the browser support it.
https://github.com/thinkphp/yqlcache
Last synced: 3 months ago
JSON representation
Wrapper to store YQL results in localStorage when the browser support it.
- Host: GitHub
- URL: https://github.com/thinkphp/yqlcache
- Owner: thinkphp
- Created: 2010-11-18T09:00:23.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2012-04-11T11:34:52.000Z (almost 14 years ago)
- Last Synced: 2024-04-14T14:54:29.531Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://thinkphp.ro/apps/js-hacks/YQL%20Utilities/YQLCache/demos/
- Size: 662 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
yqlcache
--------
A simple wrapper for YQL to support local storage.
Use like this:
yqlcache.get({
yql: "select title,link from rss where url='http://feeds.feedburner.com/nczonline'",
id: 'rssncz',
cacheage: (60 * 60 * 1000),
callback: function(data) {
console.log(data);
}
});
yql - the YQL statement
id - the storage key for localstorage
cachage - 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.
Demos: [http://thinkphp.ro/apps/js-hacks/YQL%20Utilities/YQLCache/](http://thinkphp.ro/apps/js-hacks/YQL%20Utilities/YQLCache/)