Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 2.55 KB

README.md

File metadata and controls

64 lines (44 loc) · 2.55 KB

Lingodog

A script to collect your and your friends' duolingo experience metrics and send them to your Datadog dashboards.

Simple vs Detailed metrics

  • Simple metric: only total xp is collected. This metric is tagged by friend and week_day.
  • Detailed metrics: xp by language, language level and xp required to get to the next level are also collected. These additional metrics are scraped from public duolingo profile pages. Thus the selenium module and a browser to be driven by selenium are required. These metrics are tagged by friend, week_day and language.

Installation

Project and dependencies

pip install datadog, duolingo-api
# pip install selenium # if you want detailed metrics
git clone https://github.com/MartiFlex/Lingodog.git
cd Lingodog/

Configuration

  1. Edit lingodog.conf. At least enter your datadog api_key and your duolingo username and password.
  2. Run python run_config.py to:
  • check the config
  • run metric collection once

Schedule metric collection

If you're running Linux, schedule a cronjob to collect metrics every 10 minutes or so:

(echo "*/10 * * * * $(which python) $(pwd)/lingodog.py"; crontab -l) | crontab -

Otherwise use launchctl (Mac) or Windows Task Scheduler (Windows).

Configuration

Mandatory parameters

api_key (Datadog), username, password (Duolingo)

Detailed metric collection parameters

The language_details parameter activates detailed metric collection. If omitted, it defaults to False.

If language_details = True, browser name & executable_path are required for Selenium:

  1. browser should exactly match one of the following names: PhantomJS or Chrome or Firefox.
  2. executable_path:

Example:

language_details = True
browser = PhantomJS
executable_path = ./webdrivers/phantomjs
Optional parameters
  • Change reporting metric names: parameters total_xp, language_xp, language_level, language_xp_for_next_level
  • Change Log level and log file location: log_level (set it up to DEBUG to get more logging), log_filepath