Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
beudbeud committed Nov 3, 2022
1 parent 829b63f commit 31d6ba8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
tags: beudbeud/discoger:latest,${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# discoger
# Discoger

Telegram bot for checking if there are new sell in one specific list on Discogs

## How to use it

### Installation

Installation is in three steps, the first is getting credentials from Discogs and Telegram.
You need to create a [Token](https://www.discogs.com/fr/settings/developers).

For Telegram you need contact []@BotFather](https://t.me/botfather) and follow a few simple steps for get your authorization token.

### Configuration

After that you need create config.ini file

```
[DEFAULT]
schedule_time = 30
[discogs]
secret = dbPVkGbCVVffggfgkdfgmlkknzezsbhmscskncno
[telegram]
token = 1766763279:AAFwufBsdfdsfgdfsgfgsfsgdfgsdf
```

### Docker

```
docker container run -v ./:/root/.config/discoger beudbeud/discoger
```
5 changes: 4 additions & 1 deletion discoger/discoger.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ def market_scrape(release_id, title, last_one):
user_agent = {'User-agent': 'Mozilla/5.0'}
url = f"https://www.discogs.com/fr/sell/mplistrss?output=rss&release_id={release_id}"
try:
response = requests.get(url, headers = user_agent)
response = requests.get(url, headers=user_agent)
except requests.exceptions.RequestException as e:
raise SystemExit(e)

if response.status_code == 404:
logging.error("Error to fetch data for %s" % (title))

soup = BeautifulSoup(response.content, features="xml")
# grab all the summaries and links from discogs marketplace,
# put 'em in a list
Expand Down

0 comments on commit 31d6ba8

Please sign in to comment.