I hereby claim:
- I am slaughtr on github.
- I am slaughtr (https://keybase.io/slaughtr) on keybase.
- I have a public key ASAiAKcK3e9FF20mD_8CwhJBPrEz7apKVc2iiP-7DX3_DAo
To claim this, I am signing this object:
const fetch = require('node-fetch'); | |
const cheerio = require('cheerio'); | |
const getTweets = async username => { | |
const req = await fetch(`https://twitter.com/${username}`); | |
const page = await req.text(); | |
const $ = cheerio.load(page, {xmlMode: true}); | |
const actualTweets = []; | |
const tweetHTML = $('.tweet-text').toArray(); |
I hereby claim:
To claim this, I am signing this object:
// I cannot absolutely guarantee I got everything completely correct, but I'm 95% sure I got at least 95% of it correct | |
// ----------------- | |
// --- PROMISES | |
// ----------------- | |
// Callback hell: | |
doSomething(params, (err, data) => { | |
if (err) console.error(err) | |
else { |
// get a JSON file from S3 and immediately parse the JSON to a JS object | |
const testObj = JSON.parse(await s3.getObject({ Bucket: 'test', Key: test }).promise().then(res => res.Body.toString())); | |
// get all keys from an S3 listObjectV2 as an array (assuming no pagination of results) | |
const keysArr = (await s3.listObjectsV2({Bucket: 'test', Prefix: 'test'}).promise().then(res => res.Contents)).map(item => item.Key); | |