dependabot[bot] c654828486 Bump pylint from 2.17.7 to 3.0.1 (#322)
Bumps [pylint](https://github.com/pylint-dev/pylint) from 2.17.7 to 3.0.1.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](https://github.com/pylint-dev/pylint/compare/v2.17.7...v3.0.1)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 12:19:38 -04:00
2023-02-20 23:23:29 -05:00
2023-02-20 23:43:58 -05:00
2023-02-25 14:43:21 -05:00
2023-02-20 23:23:29 -05:00
2023-02-20 23:23:29 -05:00
2020-10-26 00:35:19 -04:00
2023-02-26 22:34:17 -05:00
2021-04-04 10:38:04 -04:00
2023-03-05 20:13:55 -05:00

rfd-notify

This tool looks for matches on RedFlagDeals.com forums and will send push notifications via apprise.

This was originally written before alerts existed. With rfd-notify, alerts never expire and support regular expressions.

Prerequisites

Usage

The simplest way to get started is to clone this repo, and run with docker:

docker run -it -v "$(pwd)/examples/config.yml:/app/config.yml" ghcr.io/davegallant/rfd-notify:1

To run the code with poetry, clone this repo and run the following:

poetry install
poetry run python rfd_notify/cli.py -c examples/config.yml

Environment Variables

The following environment variables are required:

VARIABLE DESCRIPTION
APPRISE_URL See notifications.

Example Configuration

Pass a list of expressions to be used for discovering deals:

# config.yml
expressions:
  - pizza
  - starbucks
  - price error

Github Actions

Commiting the pickled data (previous_matches) back into the repository is a bit of a hack, but allows for a simpler setup.

An action can be setup to scan for deals, send a notification and store previously found deals in the repo.

It also requires the corresponding encrypted secrets setup.

# .github/workflows/rfd-notify.yml

on:
  schedule:
    - cron: "*5 * * * *"
jobs:
  rfd_notify:
    runs-on: ubuntu-latest
    name: rfd-notify
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Run rfd-notify
        uses: davegallant/rfd-notify@main
        env:
          APPRISE_URL: ${{ secrets.APPRISE_URL }}

      - name: Commit files
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "RFD Notify"
          git add previous_matches
          git commit -m "Update previous_matches" -a || true

      - name: Push changes
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}

Gitlab Pipelines

Create a scheduled pipeline to run on a regular interval.

With Gitlab Pipelines, the following configuration works:

#.gitlab-ci.yml
default:
  image:
    name: ghcr.io/davegallant/rfd-notify:1
    entrypoint: [""]

run:
  cache:
    - key: previous_matches
      paths:
        - previous_matches
  script:
    - python /app/rfd_notify/cli.py -c config.yml

Jenkins

The necessary Jenkins plugins (such as docker) and credentials must be configured.

Using a declarative pipeline, run the build every minute, and store the previous matches in the workspace:

pipeline {
    agent any

    triggers {
        cron('* * * * *')
    }

    options {
        buildDiscarder(
            logRotator(
                numToKeepStr: '25',
                artifactNumToKeepStr: '25'
            )
        )
        disableConcurrentBuilds()
    }

    stages {
        stage('Run rfd-notify') {
            agent {
                docker {
                    image 'ghcr.io/davegallant/rfd-notify:1'
                    args '--entrypoint='
                    reuseNode true
                }
            }
            steps {
                withCredentials([string(credentialsId: 'apprise-url', variable: 'APPRISE_URL')]) {
                    sh 'python /app/rfd_notify/cli.py -c config.yml'
                }
            }
        }
        stage('Archive previous_matches') {
            steps {
                archiveArtifacts artifacts: 'previous_matches'
            }
        }
    }
}
Description
get notified of deals based on regex
Readme GPL-3.0 4.5 MiB
Languages
Python 92.5%
Dockerfile 6.1%
Shell 1.4%