Git Product home page Git Product logo

beerlist's Introduction

Beer List

This project aims to provide simple interface to get lists of beers from my favourite pubs.

Supported pubs

Howto use

Separate use of parsers

  • The parsers can be used separately, there are just a few simple dependencies as mentioned in requirements.txt.
  • The parsers can be easily run in their own python virtual environment:
python3 -m venv ./venv
source /venv/bin/activate
pip3 install -r requirements.txt
python3 ./parsers/mwparser.py

Run periodically and create beerlog

  • Add update_cache.sh script to crontab
*/20 0,1,9-23 * * * /path/to/tools/update_cache.sh

Run as web service under Apache:

  • Check out the code to a web accessible directory with PHP support
  • Change group of cache directory to that of the web server (e.g. www-data)
chgrp www-data cache
chmod 6775 cache
  • Check that all files are first created by calling tools/update_cache.sh to ensure that the usr has owner rights
  • Setup log file with permissions:
touch log/beerlog.json
chgrp www-data log/beerlog.json
  • Allow mod_rewrite (a2enmod rewrite)
  • Allow .htaccess for the dir
        <Directory /var/www/html/beer>
                AllowOverride All
        </Directory>

IRC Interaction

The following features allow interacting with IRC. To connect to a selected IRC channel, set up an instance of ii (IRC file based client)

apt-get install ii
sudo cp beerbot/beerbot-connection.service /etc/systemd/user/
# the config file must be accessible even for www-data, therefore this ugly place
sudo cp beerbot/beerbot.conf /etc/
systemctl --user daemon-reload
systemctl --user enable beerbot-connection
systemctl --user start beerbot-connection

To configure the IRC server, channel and bot name, edit the beerbot.conf file.

Push new beer on tap notifications to IRC

Notifications are enabled by default and can be disabled in beerbot.conf.

Let beerbot react to commands

The beerbot can respond to IRC commands in form of !pub where pub is a shortcut of one of the supported pubs For this to work, you need to start the beerbot-connection service. Pushing notifications to IRC can be disabled.

  • Configure the path to the beerbot script in the /etc/beerbot.conf. It must be within the original directory structure.
  • The beerbot systemd service needs to be enabled:
sudo cp beerbot/beerbot.service /etc/systemd/user/
systemctl --user daemon-reload
systemctl --user enable beerbot
systemctl --user start beerbot

Push Untappd beer notifications to IRC

Untappd drinking notifications from your friends can be easily pushed to the configured IRC channel.

To enable Untappd notifications:

  • It is necessary to write Untappd user names and corresponding IRC nicks into beerbot.conf file.
    UNTAPPD_USERS="beeruser1 beeruser2"
    UNTAPPD_IRC_NICKS="cervezaadicto1 cervezaadicto2"
    
  • Add update_untappd.sh script to crontab
    */10 * * * * /path/to/tools/update_untappd.sh
    
    

Check Kaktus double credit promo

Look at https://www.mujkaktus.cz/novinky for news

To enable notifications:

  • Add nicks to be highlighted to beerbot.conf file to KAKTUS_NOTIFY variable.
  • Call kaktus update script from crontab
    10 8-20 * * * /path/to/tools/update_kaktus.sh
    

beerlist's People

Contributors

h0-- avatar swski avatar tehcaster avatar thorgrin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.