Skip to content

Instantly share code, notes, and snippets.

@cagrimmett
Last active October 13, 2023 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cagrimmett/30bf264fdef9399d1c1760cd9fa566f0 to your computer and use it in GitHub Desktop.
Save cagrimmett/30bf264fdef9399d1c1760cd9fa566f0 to your computer and use it in GitHub Desktop.
var urlTemplate = "https://drummer.land/chuck@grimmett.co/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