Created
March 12, 2016 22:18
-
-
Save andysylvester/adce6ab950c711755a1e to your computer and use it in GitHub Desktop.
This is a user script for the River5 RSS aggregator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://gist.github.com/scripting/1737c886c4f653758033 | |
var now = new Date (); | |
if (localStorage.feeds === undefined) { | |
localStorage.feeds = new Object (); | |
} | |
if (localStorage.feeds [urlfeed] === undefined) { | |
localStorage.feeds [urlfeed] = { | |
ctAdds: 0, | |
whenFirstAdd: now | |
}; | |
} | |
var thisFeed = localStorage.feeds [urlfeed]; | |
thisFeed.ctAdds++; | |
thisFeed.whenLastAdd = now; | |
if (thisFeed.stories === undefined) { | |
thisFeed.stories = new Array (); | |
} | |
thisFeed.stories [thisFeed.stories.length] = itemFromRiver.title; | |
thisFeed.stories [thisFeed.stories.length] = "Got to callback script"; | |
console.log("Got to callback script"); | |
itemFromRiver.whenLastSayHello = now; | |
if (itemFromRiver.ctHellos === undefined) { | |
itemFromRiver.ctHellos = 0; | |
} | |
itemFromRiver.ctHellos++; | |
console.log("Callback: itemFromRiver.description before change " + itemFromRiver.description); | |
itemFromRiver.description = "This is a test."; | |
console.log("Callback: itemFromRiver.description after change " + itemFromRiver.description); | |
todaysRiverChanged (); //tell River5 to save it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment