These scripts are finding new beers from your local beershop. You need to have two things be true for this to work:
- You record your unique beers in untappd
- You consider "new beers" being beers from a style you've not had before. There are 224 different styles of beer on untappd but it's really hard to see how a beer is classified just by looking at the can.
- Your local puts their beers on untappd too
- You're comfortable with some JS scripting.
After you have followed the setup you can run the following script to get a CSV that you can print or take into the shop. The first argument to the script be the path to the shop data you
node src/missing-styles.js src/data/hopheads-point-cook.json
open out/shopping-list-hopheads-point-cook.csv
npm i
- https://untappd.com/user/distributedlife/beers
- Keep clicking the "Load More" page until you have all your beers or the beers since last extract
- Open console and run the script below to convert data to JSON
- Save the file in
src/data/beers.json
JSON.stringify(
$$(".beer-item").map((c) => {
return {
name:
c.querySelector(".beer-details .name a") && c.querySelector(".beer-details .name a").text,
brewery:
c.querySelector(".beer-details .brewery a") &&
c.querySelector(".beer-details .brewery a").text,
style:
c.querySelector(".beer-details .style") &&
c.querySelector(".beer-details .style").textContent.trim(),
date:
c.querySelector(".details .date a abbr") &&
c.querySelector(".details .date a abbr").textContent.trim(),
};
})
);
I chatted with peeps at Hopheads (a local beer shop near me) and they said that they add beers more readily than when they take them off from being out of stock. You may end up with some beers that are no longer available.
- Find your beershop on Untappd e.g.
- Filter by newest first and hide beers you've had
- Keep clicking the "Load More" page until you have all your beers or the beers since last extract
- Open console and run the script below to convert data to JSON
- Save the file in
src/data/shopname.json
whereshopname
is the name you use for the shop
Data I have already
- https://untappd.com/v/hopheads/2887575 ->
src/data/hopheads-point-cook.json
- https://untappd.com/v/hopheads-altona/8072907 ->
src/data/hopheads-altona.json
- https://untappd.com/v/hopheads-yarraville/10442156 ->
src/data/hopheads-yarraville.json
JSON.stringify(
$$(".sorting-item").map((c) => {
return {
name:
c.querySelector(".beer-info .beer-details h5 a") &&
c.querySelector(".beer-info .beer-details h5 a").text,
brewery:
c.querySelector(".beer-info .beer-details h6 a") &&
c.querySelector(".beer-info .beer-details h6 a").text,
style:
c.querySelector(".beer-info .beer-details h5 em") &&
c.querySelector(".beer-info .beer-details h5 em").textContent.trim(),
prices: [...c.querySelectorAll(".beer-prices p")].map((d) => {
return {
size: d.querySelector(".size").textContent.trim(),
price: d.querySelector(".price").textContent.trim(),
};
}),
};
})
);