Skip to content

Instantly share code, notes, and snippets.

@tphummel
Last active October 31, 2018 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tphummel/5b13307542ce02e8fec4d15c4df3498d to your computer and use it in GitHub Desktop.
Save tphummel/5b13307542ce02e8fec4d15c4df3498d to your computer and use it in GitHub Desktop.
Eat Club Analytics

Eat Club Analytics

  1. log in and browse: https://www.eatclub.com/orders/past
  2. scroll to the bottom of the page and keep clicking more until your entire history is shown on the page.
  3. open chrome web console (or comparable)
  4. open javascript console
  5. run the following command
copy(Array.prototype.slice.call(document.querySelectorAll("div.item-cont.row")).map((r)=>{ return Array.prototype.slice.call(r.querySelectorAll("div.column")).map((c)=>{ return c.innerText.split("\n") }) }).map((o)=>{ return {date: o[0][0], location: o[0][1], dish: o[1][0], type: o[2][0]} }))
  1. open a new empty document in a text editor
  2. paste your clipboard
  3. save and exit
  4. open terminal and run the following command
cat eat-club-history.json| jq '.[].dish' | awk '{ FS="\n" count[$1]++}END{for(j in count) print j","count[j]}' | sort -t "," -k2 -nr | head -n 10

example output

Dish Count
Butter Chicken 18
Chicken Burrito 15
Mie Tek Tek with Beef 9
Chicken Caesar Salad 9
Wet Burrito (Asada) 6
Shrimp 'Fra Diavolo' Spaghetti 5
Pastor Burrito 5
Godmother 5
Free Range Fried Chicken Sandwich 5
Chicken Tikka Masala 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment