Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
const request = require('request'); | |
const cheerio = require('cheerio'); | |
const fs = require('fs'); | |
const writeStream = fs.createWriteStream('post.csv'); | |
// Write Headers | |
writeStream.write(`Title,Link,Date \n`); | |
request('http://codedemos.com/sampleblog', (error, response, html) => { | |
if (!error && response.statusCode == 200) { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
type ResponseWithData = Response & { data?: any }; | |
interface Fetcher { | |
run(input: RequestInfo, init?: RequestInit): Promise<ResponseWithData>; | |
} | |
class BasicFetcher implements Fetcher { | |
async run(input: RequestInfo, init?: RequestInit): Promise<ResponseWithData> { | |
return await fetch(input, init); | |
} |