Watching You Drink Beer

I noticed that many people on Twitter publish when they use the Untappd.com application. This app allows a user to “check-in” when they drink beer. They get badges, the dates and times of their drinking is noted, and many times the geographic location of where they drank is also available…..all with no authentication! Woohoo!

So I wondered if I could patch together some Python to scrape the Untappd.com web site for a given user and then do some analytics on their drinking habits. Stuff like:

  • What time of day do they drink most often?
  • What day of the week do they drink most often?
  • What day of the month do they drink most often?
  • Who do they drink with?
  • Where do they drink?
  • Are they “binge” drinking?

Caveat

Since this script scrapes the public pages (private Untappd profiles are not scraped) without using the Untappd API and without requiring login, it only has access to the last 25 beers a target has consumed. While this doesn’t sound like a lot when some of these users have noted they have drunk thousands of beers, we can learn many things from 25 beers. And what if you ran this script every week (or day!)? Could you store all the data about a specific person on a rolling basis? Yup!

Usage

Grab the code for this from https://github.com/WebBreacher/untappdScraper and you should be good (no 3rd party libraries for running).

$ python3 untappd.py -h
usage: untappd.py [-h] [-r] -u USER

Grab Untappd user activity

optional arguments:
-h, --help show this help message and exit
-r, --recent Just dump the locations of the last beers they logged
-u USER, --user USER Username to research

Example

$ python untappd.py -u nvrhapy

[ ] USER DATA: Requesting https://untappd.com/user/nvrhapy

        Total Beers:    2,454
        Total Unique:   1,217
        Total Badges:     569
        Total Friends:     16

[ ] FRIEND DATA: Requesting 25 friends from https://untappd.com/user/nvrhapy/friends

              Account               Name              Location
        -------------------- ------------------ --------------------
        yeoldstinkeye        Tight Lips Jimmy   Chicago
        Supah_Set            Joshua B.
        tommasocamilleri2    Tommaso C.         Chicago Heights, Illinois
        Joeheredia           Joe H.
        beerhere89           stephany d.
        Jwilson126           Jason W.
        fernicus             Adam F.
        1MattyG              Matty G.           Arlington Heights, IL
        traceyann83          Tracey N.
        Fatabird             Fatima F.
        greencape            Jay M.
        crispix              Christina Z.
        Redpac               Dan S.             New Lenox, IL
        pinatax              Tall S.            Chicago
        sprout1880           russell u.         chicago hieghts
        1rar3br33d           Matt

[ ] BEER CONSUMPTION DATA: Requesting https://untappd.com/user/nvrhapy/beers
[*]  Drinking Patterns (Last 25 beers) - Days of Week
         Day ( #) : HISTOGRAM
        ---------------------------------
         Mon ( 0) :
         Tue ( 0) :
         Wed ( 5) : xxxxx
         Thu ( 3) : xxx
         Fri ( 3) : xxx
         Sat ( 6) : xxxxxx
         Sun (11) : xxxxxxxxxxx

[*]  Drinking Patterns (Last 25 beers) - Hours of Day
         Hour  ( #) : HISTOGRAM
      ---------------------------------
         06:00 ( 0) :
         07:00 ( 0) :
         08:00 ( 0) :
         09:00 ( 0) :
         10:00 ( 0) :
         11:00 ( 0) :
         12:00 ( 1) : x
         13:00 ( 0) :
         14:00 ( 5) : xxxxx
         15:00 ( 2) : xx
         16:00 ( 1) : x
         17:00 ( 5) : xxxxx
         18:00 ( 3) : xxx
         19:00 ( 6) : xxxxxx
         20:00 ( 1) : x
         21:00 ( 1) : x
         22:00 ( 1) : x
         23:00 ( 1) : x
         00:00 ( 1) : x
         01:00 ( 0) :
         02:00 ( 0) :
         03:00 ( 0) :
         04:00 ( 0) :
         05:00 ( 0) :

[*]  Drinking Patterns (Last 25 beers) - Day of Month
       Day (#) : HISTOGRAM
      ---------------------------------
       00  ( 0) :
       01  ( 0) :
       02  ( 1) : x
       03  ( 0) :
       04  ( 2) : xx
       05  ( 0) :
       06  ( 1) : x
       07  ( 1) : x
       08  ( 0) :
       09  ( 0) :
       10  ( 0) :
       11  ( 1) : x
       12  ( 0) :
       13  ( 4) : xxxx
       14  ( 0) :
       15  ( 0) :
       16  ( 0) :
       17  ( 0) :
       18  ( 0) :
       19  ( 5) : xxxxx
       20  ( 1) : x
       21  ( 0) :
       22  ( 4) : xxxx
       23  ( 1) : x
       24  ( 0) :
       25  ( 1) : x
       26  ( 4) : xxxx
       27  ( 1) : x
       28  ( 0) :
       29  ( 0) :
       30  ( 0) :
       31  ( 1) : x

[!] *ALERT - Due to drinking 5 beers on day 19, user may be a "Binge Drinker"
[!]          Examine times they drank the beers below. If 5+ drinks in < 2 hours, then binge.
[!]            14:47:53
[!]            16:22:59
[!]            17:38:35
[!]            18:09:01
[!]            20:10:21
[!]      * This script does not examine the amount of time between drinks, which is important.
[!]      * https://www.niaaa.nih.gov/alcohol-health/overview-alcohol-consumption/moderate-binge-drinking

[ ] VENUE DATA: Requesting https://untappd.com/user/nvrhapy/venues?type=&sort=highest_checkin

      Checkins   Name, Address (Geocode)
      --------  ----------------------------------------------------
         633      shorts house, IL  (39.3566722, -88.4601469)
         304      steve and christinas, IL  (40.6331249, -89.3985283)
         108      Redpac's Cocktail Lounge and Beer Bar, 2145 calistoga ave New Lenox, IL  (41.48105899999999, -87.9570718)
          57      sprout's brew haus, IL  (39.8018003, -89.64711720000001)
          42      The Beer Dungeon, IL  (42.1857372, -88.4369487)
          40      Evil Horse Brewing Company, 1338 Main St Crete, IL  (41.444957, -87.631468)
          37      halsted & joe orr rd, IL  (41.5207079, -87.6356019)
          35      Peaceful Acres Resort, Larch Rd Ludington, MI  (44.0051131, -86.46920539999999)
          32      Steger Wildcat Football, IL  (41.4700348, -87.636432)
          31      One Trick Pony, 17933 Chappel Ave Lansing, IL  (41.5711478, -87.571823)
          26      Flossmoor Station Restaurant & Brewery, 1035 Sterling Ave Flossmoor, IL  (41.5433753, -87.6786252)
          24      Road America, N7390 State Road 67 Elkhart Lake, WI  (43.80450510000001, -87.9868194)
          24      Lassen's Sports Bar & Grill, 2131 183rd St Homewood, IL  (41.5570125, -87.6689267)
          23      Chicagoland Speedway, 500 Speedway Blvd Joliet, IL  (41.4749519, -88.0573003)
          22      Smokey Jo's Scratch Kitchen & Ale House, 475 W Burville Rd Crete, IL  (41.435353, -87.6304124)
          18      MountainLoft Resort, 110 Mountainloft Dr Gatlinburg, TN  (35.7306579, -83.4827645)
          17      Rock Bottom - Orland Park, 16156 South La Grange Road Orland Park, IL  (41.5960194, -87.8531833)
          17      Matts place, IL  (42.244263, -88.316465)
          17      Steger Baseball (Veterans Park), 3599 Phillips Ave Steger, IL  (41.4660376, -87.6304869)
          16      Crown Brewing, 211 S East St Crown Point, IN  (41.4158226, -87.36357629999999)
          15      Northwoods Restaurant & Saloon, 968 E Steger Rd Crete, IL  (41.46951079999999, -87.5885505)
          14      Richard D. Irwin Park, IL  (41.56096290000001, -87.6621203)
          13      The Open Bottle, 7101 183rd St, Unit 105 Tinley Park, IL  (41.5580442, -87.79042849999999)
          13      City of Chicago Heights, IL  (41.502062, -87.6399599)
          12      Eastview School, IL  (42.1572088, -88.2829004)

[ ] HTML output file named untappd_map_nvrhapy_1557162596.html was written to disk.

Comments are closed.

Up ↑

%d bloggers like this: