Skip to content

akionakamura/untappd-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Untappd Scraper

A few scripts to scrape Untappd pages. Things are pretty manual for now, but should improve as needed. For now, the only script avaible is one to scrape a given user list of checked-in beers.

Go to the user page you want to scrape:

https://untappd.com/user/username/beers

Open the browser console, here are a few instruction if you don't know how to do it.

Run the following command until all beers are loaded

    $('.more_beers.track-click').click()

Then run:

    var beers = [];
    $('.beer-item').each(function(i, beer) {
        beers[i] = {};
        var beerDetails = $(beer).find('.beer-details');
        var details = $(beer).find('.details');
        beers[i].name = beerDetails.find('.name').text();
        beers[i].brewery = beerDetails.find('.brewery').text();
        beers[i].style = beerDetails.find('.style').text();
        beers[i].myScore = parseFloat(beerDetails.find('.ratings').find('.you p').html().replace("Your Rating (", "").replace(")", ""));
        beers[i].globalScore = parseFloat(beerDetails.find('.ratings').find('.you p').last().html().replace("Global Rating (", "").replace(")", ""));
        beers[i].abv = parseFloat(details.find('.abv').html().trim().replace("% ABV", ""));
        beers[i].ibu = parseFloat(details.find('.ibu').html().trim().replace(" IBU", ""));
        // TODO Images are loaded lazily, find out a way to get the proper URL of all images.
    })

    // Prints in the console all beers in JSON format. Save the result in a text file.
    console.log(JSON.stringify(beers));

The beers JSON should be printed in the console. Copy it and have fun analyzing it :)

About

A few scripts to scrape Untappd pages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published