Last active
April 2, 2020 17:09
-
-
Save scripting/a676b0da36c13576877a91fc77a34ecb to your computer and use it in GitHub Desktop.
Example of a PagePark plug-in
This file contains hidden or 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
//translate a url in this form: http://my.this.how/davewiner/example.opml | |
//to a file path like this: /root/apps/littleoutliner/publicFiles/users/davewiner/myOutlines/example.opml | |
exports.filter = filter; | |
const folder = "/root/apps/littleoutliner/publicFiles/users/"; | |
function filter (options, callback) { | |
var url = options.httpRequest.url; | |
var splits = url.split ("?"); | |
url = splits [0]; | |
splits = url.split ("/"); | |
var f = folder + splits [1] + "/myOutlines/" + splits [2]; | |
options.serveLocalFile (f); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More info here.
scripting/Scripting-News#158 (comment)