Created
July 16, 2019 11:55
-
-
Save AdamGerthel/c07747600bbcae4677b76f6b319b7f98 to your computer and use it in GitHub Desktop.
Tinder data funnel script (node.js)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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