assmaster

node v10.24.1
version: 1.0.0
endpointsharetweet
var app = require('express')(); var cheerio = require("cheerio"); var axios = require("axios"); var url = require("url"); app.get("/*", async function(req,res) { var p = ""; var i = 0; var k = cheerio.load((await axios("https://devrant.com/static/devrant/sitemaps/current/devrant_com_sitemap.xml",{headers: {"User-Agent": "Googlebot-News"}})).data,{xmlMode: true}) var list = k("loc").map((i,x)=>k(x).text()).get().sort(); res.end(JSON.stringify(list,null,2)); }) app.listen(process.env.PORT);
Loading…

no comments

    sign in to comment