Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The Plugin used for Notifications is
- // https://github.com/saileshmittal/phonegap-system-notification-plugin
- document.addEventListener("deviceready", onDeviceReady, false);
- // PhoneGap is ready
- //
- function onDeviceReady() {
- // Empty
- }
- google.load("feeds", "1");
- google.setOnLoadCallback(function () {
- var rss1old = '',
- rss1new = '',
- rss2old ='',
- rss2new ='',
- getRss = function (url, callback) {
- (url) && (function (url) {
- var feed = new google.feeds.Feed(url);
- feed.load(function (result) {
- (!result.error && callback) && (callback(result.feed.entries[0].title));
- });
- }(url));
- };
- setInterval(function () {
- getRss(
- 'http://yofreesamples.com/category/free-coupons/feed/?type=rss',
- function (title) {
- rss1new = title;
- if(rss1old !== rss1new) {
- rss1old = rss1new;
- navigator.systemNotification.onBackground();
- navigator.systemNotification.updateNotification(rss1new,rss1new);
- navigator.notification.beep(1);
- navigator.notification.vibrate(2000);
- }
- }
- );
- },60000);
- setInterval(function () {
- getRss(
- 'http://yofreesamples.com/category/real-freebies/feed/?type=rss',
- function (title) {
- rss2new = title;
- if(rss2old !== rss2new) {
- rss2old = rss2new;
- navigator.systemNotification.onBackground();
- navigator.systemNotification.updateNotification(rss2new,rss2new);
- navigator.notification.beep(1);
- navigator.notification.vibrate(1000);
- }
- }
- );
- },60000);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement