Skip to content

Instantly share code, notes, and snippets.

@AdamGerthel
Created July 16, 2019 11:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save AdamGerthel/c07747600bbcae4677b76f6b319b7f98 to your computer and use it in GitHub Desktop.
Save AdamGerthel/c07747600bbcae4677b76f6b319b7f98 to your computer and use it in GitHub Desktop.
Tinder data funnel script (node.js)
/*
* Node.js helper script for creating a SankeyMATIC funnel
*
* Step 1: Request Tinder from https://account.gotinder.com/data
* Step 2: Wait for your data
* Step 3: Place the data.json file from your data folder next to this script
* Step 4: Run the script: `$ node index.js`
* Step 5: Copy and paste the console output here: http://sankeymatic.com/build/
*/
const data = require('./data.json')
function sum (array) {
return array.reduce((total, curr) => total+=curr, 0)
}
const leftSwipes = sum(Object.values(data.Usage.swipes_passes))
const rightSwipes = sum(Object.values(data.Usage.swipes_likes))
const matches = sum(Object.values(data.Usage.matches))
const messaged = data.Messages.length
const results = `
Swipe [${leftSwipes}] Left swipe
Swipe [${rightSwipes}] Right swipe #00CC00
Right swipe [${rightSwipes - matches}] No match
Right swipe [${matches}] Match #00CC00
Match [${messaged}] Messaged #00CC00
Match [${matches - messaged}] No message
`
console.log(results)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment