Last active
October 13, 2023 04:14
-
-
Save cagrimmett/30bf264fdef9399d1c1760cd9fa566f0 to your computer and use it in GitHub Desktop.
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
var urlTemplate = "https://drummer.land/[email protected]/MakeWordPress.opml"; | |
const request = require ("request"); | |
function httpRespond (code, type, val, headers) { | |
if (headers === undefined) { | |
headers = new Object (); | |
} | |
if (type === undefined) { //7/20/18 by DW | |
type = "text/plain"; | |
} | |
headers ["Content-Type"] = type; | |
options.httpResponse.writeHead (code, headers); | |
options.httpResponse.end (val); | |
} | |
var urlServer = "https://a8c.feedland.org/newsproduct?template=" + urlTemplate; | |
request (urlServer, function (err, response, htmltext) { | |
if (err) { | |
httpRespond (500, "text/plain", err.message); | |
} | |
else { | |
httpRespond (200, "text/html", htmltext); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment