From fdaff48df01c520281c2b2a5288f82e1f783fbe4 Mon Sep 17 00:00:00 2001 From: Rafael Franco Date: Sat, 20 May 2023 11:57:28 -0300 Subject: [PATCH] chore: update readme --- .github/workflows/streak-keeper.yml | 4 +--- .github/workflows/study.yml | 4 +--- README.md | 21 ++++++++++++++++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/streak-keeper.yml b/.github/workflows/streak-keeper.yml index 254952a..6857f2e 100644 --- a/.github/workflows/streak-keeper.yml +++ b/.github/workflows/streak-keeper.yml @@ -4,9 +4,6 @@ on: schedule: - cron: '0 9 * * *' -env: - DUOLINGO_JWT: ${{ secrets.DUOLINGO_JWT }} - jobs: study: runs-on: ubuntu-latest @@ -19,4 +16,5 @@ jobs: - run: node index.js env: + DUOLINGO_JWT: ${{ secrets.DUOLINGO_JWT }} LESSONS: 1 diff --git a/.github/workflows/study.yml b/.github/workflows/study.yml index d51945d..ce9d10d 100644 --- a/.github/workflows/study.yml +++ b/.github/workflows/study.yml @@ -9,9 +9,6 @@ on: required: false type: number -env: - DUOLINGO_JWT: ${{ secrets.DUOLINGO_JWT }} - jobs: study: runs-on: ubuntu-latest @@ -24,4 +21,5 @@ jobs: - run: node index.js env: + DUOLINGO_JWT: ${{ secrets.DUOLINGO_JWT }} LESSONS: ${{ inputs.lessons }} diff --git a/README.md b/README.md index 2c32d99..e77733c 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,28 @@ Streak keeper and XP farm for Duolingo. Never get demoted again! -## Streak Keeper +## Usage + +To make it work, you need to make get an authorization token from the [Duoliongo](duolingo.com) web app. Simply run the following script in the browser's console while logged in: + +```js +document.cookie + .split(';') + .find(cookie => cookie.includes('jwt_token')) + .split('=')[1] +``` + +Then copy the token given and set a (repository secret)[https://docs.github.com/actions/learn-github-actions/variables] with the name `DUOLINGO_JWT` in your GitHub Actions settings. + +## Workflows + +### 🔥 Streak Keeper This project uses GitHub Actions scheduled workflow to keep your streak alive. The workflow can be viewed [here](.github/workflows/streak-keeper.yml). -## Study +### 📚 Study -This repository can also "study" lessons for you. This will give you XP so you won't get demoted never again! This workflow uses [workflow_dispatch](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) to trigger the study session. You can choose the number of lessons to be done. The workflow can be viewed [here](.github/workflows/study.yml). +This repository can also "study" lessons for you. This will give you XP so you won't get demoted never again! This workflow uses [workflow_dispatch](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) to trigger the study session. You can choose the number of lessons to be done. The workflow can be viewed [here](.github/workflows/study.yml). ## Caveats