Compare commits

..

8 Commits

Author SHA1 Message Date
ff3d3b086d Update dependency requests to ~=2.28.1
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2022-09-18 00:55:42 +02:00
6b339e09fc Merge pull request 'Configure Renovate' (#417) from renovate/configure into main
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #417
2022-09-18 00:51:35 +02:00
364f8596ae Add renovate.json
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
2022-09-18 00:51:28 +02:00
752d92be49 Fixed renovate
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-09-18 00:51:12 +02:00
97ce099485 Try to fix renovate
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-09-18 00:48:22 +02:00
cc9af56da7 Fixed renovate
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-09-18 00:46:23 +02:00
4adf14d7cb „.renovaterc.json“ löschen
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-09-18 00:45:54 +02:00
7595d42f9a Migrate from github to gitea + some improvements 2022-09-18 00:39:03 +02:00
20 changed files with 113 additions and 329 deletions

View File

@@ -1,27 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# API
- package-ecosystem: "pip"
directory: "/api"
schedule:
interval: "daily"
open-pull-requests-limit: 100
# Bot
- package-ecosystem: "pip"
directory: "/telegram_bot"
schedule:
interval: "daily"
open-pull-requests-limit: 100
# Frontend
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "daily"
open-pull-requests-limit: 100

4
.renovaterc.json Normal file
View File

@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"schedule": ["* 5 * * *"]
}

View File

@@ -77,9 +77,9 @@ pipeline:
password: password:
from_secret: ssh_password from_secret: ssh_password
script: script:
- cd /root/docker/aktienbot - cd ~/docker-compose-files/telegram_aktien_bot
- docker-compose pull - docker-compose pull
- docker-compose -p "aktienbot" up -d - docker-compose --env-file ~/docker-compose-env/telegram_aktien_bot.env up -d
when: when:
path: [ "frontend/**", "telegram_bot/**", "api/**" ] path: [ "frontend/**", "telegram_bot/**", "api/**" ]
event: push event: push

View File

@@ -1,4 +1,4 @@
[![Build Status](https://woodpecker.flokaiser.com/api/badges/WebEngineering2/TelegramAktienBot/status.svg)](https://woodpecker.flokaiser.com/WebEngineering2/TelegramAktienBot/) [![Build Status](https://gitea.woodpecker.flokaiser.com/api/badges/DHBW/TelegramAktienBot/status.svg)](https://gitea.woodpecker.flokaiser.com/DHBW/TelegramAktienBot)
# TelegramAktienBot # TelegramAktienBot
WebEngineering2 Projekt: Aktien und News Bot für Telegram WebEngineering2 Projekt: Aktien und News Bot für Telegram
@@ -21,16 +21,4 @@ WebEngineering2 Projekt: Aktien und News Bot für Telegram
* Florian Kaiser * Florian Kaiser
* Florian Kellermann * Florian Kellermann
* Linus Eickhoff * Linus Eickhoff
* Kevin Pauer * Kevin Pauer
## Nützliche Tools
- Portainer (https://gruppe1.testsites.info/portainer/) \
*Container Management System*
- phpMyAdmin (https://gruppe1.testsites.info/phpmyadmin/) \
*Administration von MySQL-Datenbanken*
- goaccess (https://gruppe1.testsites.info/goaccess/) \
*Webanalyseanwendung*
- Uptimekuma (https://uptimekuma.flokaiser.com/status/aktienbot) \
*Monitoring*
- Woodpecker (https://woodpecker.flokaiser.com/WebEngineering2/TelegramAktienBot) \
*Continuous Integration platform*

View File

@@ -64,10 +64,15 @@ token = requests.post(os.getenv("API_URL") + '/user/login', json={"email": usern
response = requests.get(os.getenv("API_URL") + '/symbols', headers={'Authorization': 'Bearer ' + token}).json()['data'] response = requests.get(os.getenv("API_URL") + '/symbols', headers={'Authorization': 'Bearer ' + token}).json()['data']
symbols = split(response, int(len(response) / 5)) if len(response) > 5:
for symbol_list in symbols: symbols = split(response, int(len(response) / 5))
for symbol in symbol_list: for symbol_list in symbols:
x = threading.Thread(target=thread_function, args=(symbol,)) for symbol in symbol_list:
x.start() x = threading.Thread(target=thread_function, args=(symbol,))
x.start()
time.sleep(10) time.sleep(10)
else:
for symbol in response:
x = threading.Thread(target=thread_function, args=(symbol,))
x.start()

View File

@@ -12,7 +12,7 @@ pytest~=7.1.2
pytest-cov pytest-cov
marshmallow~=3.15.0 marshmallow~=3.15.0
faker~=13.11.0 faker~=13.11.0
requests~=2.27.1 requests~=2.28.1
investpy~=1.0.8 investpy~=1.0.8
pandas~=1.4.2 pandas~=1.4.2
currencyconverter~=0.16.12 currencyconverter~=0.16.12

View File

@@ -12,7 +12,7 @@ BOT_EMAIL=
BOT_PASSWORD= BOT_PASSWORD=
# urls # urls
WEBSITE_URL= APP_URL=
API_URL= API_URL=
# timezone # timezone

View File

@@ -1,7 +1,7 @@
# Dokumentation # Dokumentation
## Swagger Documentation ## Swagger Documentation
Visit https://gruppe1.testsites.info/api/docs Visit \<API_URL\> + /docs
## API ## API
- `api/openapi.json` - `api/openapi.json`

View File

@@ -37,7 +37,7 @@
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "5.23.0", "@typescript-eslint/eslint-plugin": "5.23.0",
"@typescript-eslint/parser": "5.22.0", "@typescript-eslint/parser": "5.22.0",
"eslint": "^8.23.1", "eslint": "^8.15.0",
"jasmine-core": "~4.1.0", "jasmine-core": "~4.1.0",
"karma": "~6.3.19", "karma": "~6.3.19",
"karma-chrome-launcher": "~3.1.0", "karma-chrome-launcher": "~3.1.0",
@@ -2452,15 +2452,15 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "1.3.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.2.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz",
"integrity": "sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==", "integrity": "sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
"debug": "^4.3.2", "debug": "^4.3.2",
"espree": "^9.4.0", "espree": "^9.3.2",
"globals": "^13.15.0", "globals": "^13.9.0",
"ignore": "^5.2.0", "ignore": "^5.2.0",
"import-fresh": "^3.2.1", "import-fresh": "^3.2.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
@@ -2469,9 +2469,6 @@
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/@eslint/eslintrc/node_modules/ajv": { "node_modules/@eslint/eslintrc/node_modules/ajv": {
@@ -2497,9 +2494,9 @@
"dev": true "dev": true
}, },
"node_modules/@eslint/eslintrc/node_modules/globals": { "node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "13.17.0", "version": "13.14.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.14.0.tgz",
"integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "integrity": "sha512-ERO68sOYwm5UuLvSJTY7w7NP2c8S4UcXs3X1GBX8cwOr+ShOcDBbCY5mH4zxz0jsYCdJ8ve8Mv9n2YGJMB1aeg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@@ -2560,9 +2557,9 @@
"dev": true "dev": true
}, },
"node_modules/@humanwhocodes/config-array": { "node_modules/@humanwhocodes/config-array": {
"version": "0.10.4", "version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",
"integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@humanwhocodes/object-schema": "^1.2.1", "@humanwhocodes/object-schema": "^1.2.1",
@@ -2573,29 +2570,6 @@
"node": ">=10.10.0" "node": ">=10.10.0"
} }
}, },
"node_modules/@humanwhocodes/gitignore-to-minimatch": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz",
"integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==",
"dev": true,
"funding": {
"type": "github",
"url": "https://github.com/sponsors/nzakas"
}
},
"node_modules/@humanwhocodes/module-importer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
"integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
"dev": true,
"engines": {
"node": ">=12.22"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/nzakas"
}
},
"node_modules/@humanwhocodes/object-schema": { "node_modules/@humanwhocodes/object-schema": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
@@ -4440,9 +4414,9 @@
} }
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.8.0", "version": "8.7.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz",
"integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==",
"dev": true, "dev": true,
"bin": { "bin": {
"acorn": "bin/acorn" "acorn": "bin/acorn"
@@ -6905,15 +6879,13 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.23.1", "version": "8.15.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.23.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz",
"integrity": "sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg==", "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint/eslintrc": "^1.3.2", "@eslint/eslintrc": "^1.2.3",
"@humanwhocodes/config-array": "^0.10.4", "@humanwhocodes/config-array": "^0.9.2",
"@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
"@humanwhocodes/module-importer": "^1.0.1",
"ajv": "^6.10.0", "ajv": "^6.10.0",
"chalk": "^4.0.0", "chalk": "^4.0.0",
"cross-spawn": "^7.0.2", "cross-spawn": "^7.0.2",
@@ -6923,21 +6895,18 @@
"eslint-scope": "^7.1.1", "eslint-scope": "^7.1.1",
"eslint-utils": "^3.0.0", "eslint-utils": "^3.0.0",
"eslint-visitor-keys": "^3.3.0", "eslint-visitor-keys": "^3.3.0",
"espree": "^9.4.0", "espree": "^9.3.2",
"esquery": "^1.4.0", "esquery": "^1.4.0",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1", "file-entry-cache": "^6.0.1",
"find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1",
"glob-parent": "^6.0.1", "glob-parent": "^6.0.1",
"globals": "^13.15.0", "globals": "^13.6.0",
"globby": "^11.1.0",
"grapheme-splitter": "^1.0.4",
"ignore": "^5.2.0", "ignore": "^5.2.0",
"import-fresh": "^3.0.0", "import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4", "imurmurhash": "^0.1.4",
"is-glob": "^4.0.0", "is-glob": "^4.0.0",
"js-sdsl": "^4.1.4",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1", "json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1", "levn": "^0.4.1",
@@ -6948,7 +6917,8 @@
"regexpp": "^3.2.0", "regexpp": "^3.2.0",
"strip-ansi": "^6.0.1", "strip-ansi": "^6.0.1",
"strip-json-comments": "^3.1.0", "strip-json-comments": "^3.1.0",
"text-table": "^0.2.0" "text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
}, },
"bin": { "bin": {
"eslint": "bin/eslint.js" "eslint": "bin/eslint.js"
@@ -7114,22 +7084,6 @@
"node": ">=4.0" "node": ">=4.0"
} }
}, },
"node_modules/eslint/node_modules/find-up": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
"dev": true,
"dependencies": {
"locate-path": "^6.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint/node_modules/glob-parent": { "node_modules/eslint/node_modules/glob-parent": {
"version": "6.0.2", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -7143,9 +7097,9 @@
} }
}, },
"node_modules/eslint/node_modules/globals": { "node_modules/eslint/node_modules/globals": {
"version": "13.17.0", "version": "13.13.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz",
"integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@@ -7184,21 +7138,6 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true "dev": true
}, },
"node_modules/eslint/node_modules/locate-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
"dev": true,
"dependencies": {
"p-locate": "^5.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint/node_modules/minimatch": { "node_modules/eslint/node_modules/minimatch": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@@ -7211,36 +7150,6 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/eslint/node_modules/p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
"dev": true,
"dependencies": {
"yocto-queue": "^0.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint/node_modules/p-locate": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
"dev": true,
"dependencies": {
"p-limit": "^3.0.2"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/eslint/node_modules/supports-color": { "node_modules/eslint/node_modules/supports-color": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -7266,20 +7175,17 @@
} }
}, },
"node_modules/espree": { "node_modules/espree": {
"version": "9.4.0", "version": "9.3.2",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz",
"integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"acorn": "^8.8.0", "acorn": "^8.7.1",
"acorn-jsx": "^5.3.2", "acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.3.0"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/esprima": { "node_modules/esprima": {
@@ -8062,12 +7968,6 @@
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
"dev": true "dev": true
}, },
"node_modules/grapheme-splitter": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"dev": true
},
"node_modules/handle-thing": { "node_modules/handle-thing": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz",
@@ -9111,12 +9011,6 @@
"url": "https://github.com/chalk/supports-color?sponsor=1" "url": "https://github.com/chalk/supports-color?sponsor=1"
} }
}, },
"node_modules/js-sdsl": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.4.tgz",
"integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==",
"dev": true
},
"node_modules/js-tokens": { "node_modules/js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -14080,18 +13974,6 @@
"node": ">=12" "node": ">=12"
} }
}, },
"node_modules/yocto-queue": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/zone.js": { "node_modules/zone.js": {
"version": "0.11.5", "version": "0.11.5",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.5.tgz", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.5.tgz",
@@ -15785,15 +15667,15 @@
"dev": true "dev": true
}, },
"@eslint/eslintrc": { "@eslint/eslintrc": {
"version": "1.3.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.2.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.3.tgz",
"integrity": "sha512-AXYd23w1S/bv3fTs3Lz0vjiYemS08jWkI3hYyS9I1ry+0f+Yjs1wm+sU0BS8qDOPrBIkp4qHYC16I8uVtpLajQ==", "integrity": "sha512-uGo44hIwoLGNyduRpjdEpovcbMdd+Nv7amtmJxnKmI8xj6yd5LncmSwDa5NgX/41lIFJtkjD6YdVfgEzPfJ5UA==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
"debug": "^4.3.2", "debug": "^4.3.2",
"espree": "^9.4.0", "espree": "^9.3.2",
"globals": "^13.15.0", "globals": "^13.9.0",
"ignore": "^5.2.0", "ignore": "^5.2.0",
"import-fresh": "^3.2.1", "import-fresh": "^3.2.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
@@ -15820,9 +15702,9 @@
"dev": true "dev": true
}, },
"globals": { "globals": {
"version": "13.17.0", "version": "13.14.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.14.0.tgz",
"integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "integrity": "sha512-ERO68sOYwm5UuLvSJTY7w7NP2c8S4UcXs3X1GBX8cwOr+ShOcDBbCY5mH4zxz0jsYCdJ8ve8Mv9n2YGJMB1aeg==",
"dev": true, "dev": true,
"requires": { "requires": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@@ -15867,9 +15749,9 @@
"dev": true "dev": true
}, },
"@humanwhocodes/config-array": { "@humanwhocodes/config-array": {
"version": "0.10.4", "version": "0.9.5",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz",
"integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@humanwhocodes/object-schema": "^1.2.1", "@humanwhocodes/object-schema": "^1.2.1",
@@ -15877,18 +15759,6 @@
"minimatch": "^3.0.4" "minimatch": "^3.0.4"
} }
}, },
"@humanwhocodes/gitignore-to-minimatch": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz",
"integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==",
"dev": true
},
"@humanwhocodes/module-importer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
"integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
"dev": true
},
"@humanwhocodes/object-schema": { "@humanwhocodes/object-schema": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz",
@@ -17226,9 +17096,9 @@
} }
}, },
"acorn": { "acorn": {
"version": "8.8.0", "version": "8.7.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz",
"integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==",
"dev": true "dev": true
}, },
"acorn-import-assertions": { "acorn-import-assertions": {
@@ -18967,15 +18837,13 @@
"dev": true "dev": true
}, },
"eslint": { "eslint": {
"version": "8.23.1", "version": "8.15.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.23.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.15.0.tgz",
"integrity": "sha512-w7C1IXCc6fNqjpuYd0yPlcTKKmHlHHktRkzmBPZ+7cvNBQuiNjx0xaMTjAJGCafJhQkrFJooREv0CtrVzmHwqg==", "integrity": "sha512-GG5USZ1jhCu8HJkzGgeK8/+RGnHaNYZGrGDzUtigK3BsGESW/rs2az23XqE0WVwDxy1VRvvjSSGu5nB0Bu+6SA==",
"dev": true, "dev": true,
"requires": { "requires": {
"@eslint/eslintrc": "^1.3.2", "@eslint/eslintrc": "^1.2.3",
"@humanwhocodes/config-array": "^0.10.4", "@humanwhocodes/config-array": "^0.9.2",
"@humanwhocodes/gitignore-to-minimatch": "^1.0.2",
"@humanwhocodes/module-importer": "^1.0.1",
"ajv": "^6.10.0", "ajv": "^6.10.0",
"chalk": "^4.0.0", "chalk": "^4.0.0",
"cross-spawn": "^7.0.2", "cross-spawn": "^7.0.2",
@@ -18985,21 +18853,18 @@
"eslint-scope": "^7.1.1", "eslint-scope": "^7.1.1",
"eslint-utils": "^3.0.0", "eslint-utils": "^3.0.0",
"eslint-visitor-keys": "^3.3.0", "eslint-visitor-keys": "^3.3.0",
"espree": "^9.4.0", "espree": "^9.3.2",
"esquery": "^1.4.0", "esquery": "^1.4.0",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"file-entry-cache": "^6.0.1", "file-entry-cache": "^6.0.1",
"find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1",
"glob-parent": "^6.0.1", "glob-parent": "^6.0.1",
"globals": "^13.15.0", "globals": "^13.6.0",
"globby": "^11.1.0",
"grapheme-splitter": "^1.0.4",
"ignore": "^5.2.0", "ignore": "^5.2.0",
"import-fresh": "^3.0.0", "import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4", "imurmurhash": "^0.1.4",
"is-glob": "^4.0.0", "is-glob": "^4.0.0",
"js-sdsl": "^4.1.4",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"json-stable-stringify-without-jsonify": "^1.0.1", "json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.4.1", "levn": "^0.4.1",
@@ -19010,7 +18875,8 @@
"regexpp": "^3.2.0", "regexpp": "^3.2.0",
"strip-ansi": "^6.0.1", "strip-ansi": "^6.0.1",
"strip-json-comments": "^3.1.0", "strip-json-comments": "^3.1.0",
"text-table": "^0.2.0" "text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
}, },
"dependencies": { "dependencies": {
"ajv": { "ajv": {
@@ -19087,16 +18953,6 @@
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"dev": true "dev": true
}, },
"find-up": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
"integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
"dev": true,
"requires": {
"locate-path": "^6.0.0",
"path-exists": "^4.0.0"
}
},
"glob-parent": { "glob-parent": {
"version": "6.0.2", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -19107,9 +18963,9 @@
} }
}, },
"globals": { "globals": {
"version": "13.17.0", "version": "13.13.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz",
"integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==",
"dev": true, "dev": true,
"requires": { "requires": {
"type-fest": "^0.20.2" "type-fest": "^0.20.2"
@@ -19136,15 +18992,6 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true "dev": true
}, },
"locate-path": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
"integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
"dev": true,
"requires": {
"p-locate": "^5.0.0"
}
},
"minimatch": { "minimatch": {
"version": "3.1.2", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@@ -19154,24 +19001,6 @@
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
"integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
"dev": true,
"requires": {
"yocto-queue": "^0.1.0"
}
},
"p-locate": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
"integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
"dev": true,
"requires": {
"p-limit": "^3.0.2"
}
},
"supports-color": { "supports-color": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -19223,12 +19052,12 @@
"dev": true "dev": true
}, },
"espree": { "espree": {
"version": "9.4.0", "version": "9.3.2",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz",
"integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==",
"dev": true, "dev": true,
"requires": { "requires": {
"acorn": "^8.8.0", "acorn": "^8.7.1",
"acorn-jsx": "^5.3.2", "acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.3.0"
} }
@@ -19832,12 +19661,6 @@
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
"dev": true "dev": true
}, },
"grapheme-splitter": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
"dev": true
},
"handle-thing": { "handle-thing": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz",
@@ -20614,12 +20437,6 @@
} }
} }
}, },
"js-sdsl": {
"version": "4.1.4",
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.4.tgz",
"integrity": "sha512-Y2/yD55y5jteOAmY50JbUZYwk3CP3wnLPEZnlR1w9oKhITrBEtAxwuWKebFf8hMrPMgbYwFoWK/lH2sBkErELw==",
"dev": true
},
"js-tokens": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -24274,12 +24091,6 @@
"integrity": "sha512-8eblPHTL7ZWRkyjIZJjnGf+TijiKJSwA24svzLRVvtgoi/RZiKa9fFQTrlx0OKLnyHSdt/enrdadji6WFfESVA==", "integrity": "sha512-8eblPHTL7ZWRkyjIZJjnGf+TijiKJSwA24svzLRVvtgoi/RZiKa9fFQTrlx0OKLnyHSdt/enrdadji6WFfESVA==",
"dev": true "dev": true
}, },
"yocto-queue": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
"dev": true
},
"zone.js": { "zone.js": {
"version": "0.11.5", "version": "0.11.5",
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.5.tgz", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.11.5.tgz",

View File

@@ -41,7 +41,7 @@
"@types/node": "^12.11.1", "@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "5.23.0", "@typescript-eslint/eslint-plugin": "5.23.0",
"@typescript-eslint/parser": "5.22.0", "@typescript-eslint/parser": "5.22.0",
"eslint": "^8.23.1", "eslint": "^8.15.0",
"jasmine-core": "~4.1.0", "jasmine-core": "~4.1.0",
"karma": "~6.3.19", "karma": "~6.3.19",
"karma-chrome-launcher": "~3.1.0", "karma-chrome-launcher": "~3.1.0",

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
const AUTH_API = 'https://gruppe1.testsites.info/api/user'; const AUTH_API = '/api/user';
const httpOptions = { const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }), headers: new HttpHeaders({ 'Content-Type': 'application/json' }),

View File

@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { TokenStorageService } from './token.service'; import { TokenStorageService } from './token.service';
const API_URL = 'https://gruppe1.testsites.info/api/'; const API_URL = '/api/';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',

View File

@@ -2,7 +2,7 @@ import { Injectable, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { delay, Observable } from 'rxjs'; import { delay, Observable } from 'rxjs';
import { TokenStorageService } from './token.service'; import { TokenStorageService } from './token.service';
const API_URL = 'https://gruppe1.testsites.info/api/'; const API_URL = '/api/';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })

View File

@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { TokenStorageService } from './token.service'; import { TokenStorageService } from './token.service';
const API_URL = 'https://gruppe1.testsites.info/api/'; const API_URL = '/api/';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@@ -77,7 +77,7 @@ export class ProfileService {
*/ */
public addCronString(cron: string): Observable<any> { public addCronString(cron: string): Observable<any> {
return this.http.put( return this.http.put(
'https://gruppe1.testsites.info/api/user' + '/setCron', '/api/user' + '/setCron',
{ {
cron, cron,
}, },

3
renovate.json Normal file
View File

@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

View File

@@ -12,7 +12,7 @@ BOT_EMAIL=
BOT_PASSWORD= BOT_PASSWORD=
# urls # urls
WEBSITE_URL= APP_URL=
API_URL= API_URL=
# timezone # timezone

View File

@@ -19,7 +19,7 @@ from dotenv import load_dotenv
load_dotenv() # loads environment vars load_dotenv() # loads environment vars
# note: for more information about the api visit swagger documentation on https://gruppe1.testsites.info/api/docs#/ # note: for more information about the api visit swagger documentation on os.getenv("API_URL")/docs#/
class API_Handler: class API_Handler:
"""class for interacting with the api webservice """class for interacting with the api webservice
@@ -392,7 +392,7 @@ class API_Handler:
if __name__ == "__main__": # editable, just for basic on the go testing of new functions if __name__ == "__main__": # editable, just for basic on the go testing of new functions
print("This is a module for the telegram bot. It is not intended to be run directly.") print("This is a module for the telegram bot. It is not intended to be run directly.")
handler = API_Handler("https://gruppe1.testsites.info/api", str(os.getenv("BOT_EMAIL")), str(os.getenv("BOT_PASSWORD"))) # get creds from env handler = API_Handler(os.getenv("API_URL"), str(os.getenv("BOT_EMAIL")), str(os.getenv("BOT_PASSWORD"))) # get creds from env
print(handler.token) print(handler.token)
keywords = handler.get_user_keywords(user_id=1709356058) # user_id here is currently mine (Linus) keywords = handler.get_user_keywords(user_id=1709356058) # user_id here is currently mine (Linus)
print(keywords) print(keywords)

View File

@@ -50,7 +50,7 @@ def send_start(message):
""" """
bot.reply_to(message, "Welcome to this share bot project. \ bot.reply_to(message, "Welcome to this share bot project. \
\nType /help to get information on what this bot can do. \ \nType /help to get information on what this bot can do. \
\nAlso see " + os.getenv("WEBSITE_URL") + " \ \nAlso see " + os.getenv("APP_URL") + " \
to start configuring your bot") to start configuring your bot")
@@ -78,7 +78,7 @@ def send_help(message):
:rtype: none :rtype: none
""" """
bot.reply_to(message, bot.reply_to(message,
"/id or /auth get your user id\n/shares get update on interesting shares\n/setAdmin set admin rights of user (ADMIN)\n/users see all users. (ADMIN)\n/me get my user info\n/news get top article for each keyword.\n/allnews get all news (last 7 days)\n/keywords get all your keywords\n/addkeyword add a keyword\n/removekeyword remove a keyword\n/transactions get all transactions\n/newtransaction create new transaction\n/share get price of specific share\n/portfolio see own stock portfolio\n/removeshare removes share from portfolio\n/interval get update interval\n/setinterval set update interval\n For further details see " + os.getenv("WEBSITE_URL")) "/id or /auth get your user id\n/shares get update on interesting shares\n/setAdmin set admin rights of user (ADMIN)\n/users see all users. (ADMIN)\n/me get my user info\n/news get top article for each keyword.\n/allnews get all news (last 7 days)\n/keywords get all your keywords\n/addkeyword add a keyword\n/removekeyword remove a keyword\n/transactions get all transactions\n/newtransaction create new transaction\n/share get price of specific share\n/portfolio see own stock portfolio\n/removeshare removes share from portfolio\n/interval get update interval\n/setinterval set update interval\n For further details see " + os.getenv("APP_URL"))
@bot.message_handler(commands=['users', 'Users']) # /users -> sending all users @bot.message_handler(commands=['users', 'Users']) # /users -> sending all users
@@ -170,7 +170,7 @@ def send_user(message):
user_id = int(message.from_user.id) user_id = int(message.from_user.id)
user_data = api_handler.get_user(user_id) user_data = api_handler.get_user(user_id)
if not user_data or user_data == None: # true if user is not registered if not user_data or user_data == None: # true if user is not registered
bot.reply_to(message, "This didn\'t work. Make sure to connect your telegram id (/id) on " + os.getenv("WEBSITE_URL")) bot.reply_to(message, "This didn\'t work. Make sure to connect your telegram id (/id) on " + os.getenv("APP_URL"))
return return
username = user_data['username'] username = user_data['username']
email = user_data['email'] email = user_data['email']
@@ -190,7 +190,7 @@ def send_id(message):
:rtype: none :rtype: none
""" """
answer = 'Your ID/Authentication Code is: [' + str(message.from_user.id) + ']. Enter this code in the settings on ' + os.getenv("WEBSITE_URL") + ' to get updates on your shares.' answer = 'Your ID/Authentication Code is: [' + str(message.from_user.id) + ']. Enter this code in the settings on ' + os.getenv("APP_URL") + ' to get updates on your shares.'
bot.reply_to(message, answer) bot.reply_to(message, answer)
@@ -219,7 +219,7 @@ def update_for_user(message):
my_portfolio = p_my_handler.get_user_portfolio(p_user_id) my_portfolio = p_my_handler.get_user_portfolio(p_user_id)
if my_portfolio == None: # true if user is not registered if my_portfolio == None: # true if user is not registered
bot.send_message(chat_id=p_user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=p_user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL"))
return return
my_user = p_my_handler.get_user(p_user_id) my_user = p_my_handler.get_user(p_user_id)
@@ -240,7 +240,7 @@ def update_for_user(message):
my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {amounts}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR' my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {amounts}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR'
bot.send_message(chat_id=p_user_id, text=my_update_message, parse_mode="MARKDOWNV2") bot.send_message(chat_id=p_user_id, text=my_update_message, parse_mode="MARKDOWNV2")
else: else:
send_to_user("No shares found for your account. Check " + os.getenv("WEBSITE_URL") + " to change your settings and add shares.", pUser_id=p_user_id) send_to_user("No shares found for your account. Check " + os.getenv("APP_URL") + " to change your settings and add shares.", pUser_id=p_user_id)
def send_to_user(pText, pUser_id): def send_to_user(pText, pUser_id):
@@ -294,7 +294,7 @@ def send_all_news(message):
keywords = api_handler.get_user_keywords(user_id) # get keywords of user keywords = api_handler.get_user_keywords(user_id) # get keywords of user
if keywords == None: # true if user is not registered if keywords == None: # true if user is not registered
bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL"))
return return
if not keywords: # true if user is registered but does not have any keywords if not keywords: # true if user is registered but does not have any keywords
@@ -330,7 +330,7 @@ def send_news(message):
keywords = api_handler.get_user_keywords(user_id) # get keywords of user keywords = api_handler.get_user_keywords(user_id) # get keywords of user
if keywords == None: # true if user is not registered if keywords == None: # true if user is not registered
bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL"))
return return
if not keywords: # true if user is registered but does not have any keywords if not keywords: # true if user is registered but does not have any keywords
@@ -375,7 +375,7 @@ def store_keyword(message):
if status == 200: # statuscode 200 means keyword was added successfully without errors if status == 200: # statuscode 200 means keyword was added successfully without errors
bot.send_message(chat_id=user_id, text=f'Keyword "{keyword}" added.') # duplicate keywords are denied by Database, so no need to check for that here bot.send_message(chat_id=user_id, text=f'Keyword "{keyword}" added.') # duplicate keywords are denied by Database, so no need to check for that here
else: else:
bot.send_message(chat_id=user_id, text=f'Keyword "{keyword}" could not be stored. Make sure to connect your telegram id (/id) on https://gruppe1.testsites.info (statuscode {status})') bot.send_message(chat_id=user_id, text=f'Keyword "{keyword}" could not be stored. Make sure to connect your telegram id (/id) on {os.getenv("APP_URL")} (statuscode {status})')
@bot.message_handler(commands=['removekeyword', 'Removekeyword']) # /removekeyword -> remove keyword from user @bot.message_handler(commands=['removekeyword', 'Removekeyword']) # /removekeyword -> remove keyword from user
@@ -417,7 +417,7 @@ def send_keywords(message):
keywords = api_handler.get_user_keywords(user_id) # get keywords of user keywords = api_handler.get_user_keywords(user_id) # get keywords of user
if keywords == None: # true if user is not registered if keywords == None: # true if user is not registered
bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL"))
return return
if not keywords: # true if user is registered but does not have any keywords if not keywords: # true if user is registered but does not have any keywords
@@ -513,7 +513,7 @@ def send_interval(message):
user_id = int(message.from_user.id) user_id = int(message.from_user.id)
user_data = api_handler.get_user(user_id) # get cron interval of user (stored in user data) user_data = api_handler.get_user(user_id) # get cron interval of user (stored in user data)
if user_data == None: # true if user is not registered in DB if user_data == None: # true if user is not registered in DB
bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL") + ' and set an interval with /setinterval') bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL") + ' and set an interval with /setinterval')
return return
else: # send interval else: # send interval
interval = str(user_data['cron']) # get cron from user data interval = str(user_data['cron']) # get cron from user data
@@ -538,7 +538,7 @@ def send_transactions(message):
transactions = api_handler.get_user_transactions(user_id) # get transactions of user transactions = api_handler.get_user_transactions(user_id) # get transactions of user
if transactions == None: # true if user does not exist if transactions == None: # true if user does not exist
bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL"))
return return
if not transactions: # true if user has no transactions if not transactions: # true if user has no transactions
@@ -571,9 +571,9 @@ def send_shares(message):
shares = api_handler.get_user_shares(user_id) # get shares of user shares = api_handler.get_user_shares(user_id) # get shares of user
if shares == None: # true if user does not exist if shares == None: # true if user does not exist
bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=user_id, text='This didn\'t work. Make sure to connect your telegram id (/id) on ' + os.getenv("APP_URL"))
elif not shares: # true if user has no shares elif not shares: # true if user has no shares
bot.send_message(chat_id=user_id, text='You do not have any shares. Add shares on ' + os.getenv("WEBSITE_URL")) bot.send_message(chat_id=user_id, text='You do not have any shares. Add shares on ' + os.getenv("APP_URL"))
else: else:
for element in shares: for element in shares:
bot.send_message(chat_id=user_id, text=share_fetcher.get_share_information_markdown(element), parse_mode="MARKDOWNV2") bot.send_message(chat_id=user_id, text=share_fetcher.get_share_information_markdown(element), parse_mode="MARKDOWNV2")

View File

@@ -156,7 +156,7 @@ def update_for_user(p_user_id, p_my_handler):
my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {hf.make_markdown_proof(share_amounts[i])}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR' my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {hf.make_markdown_proof(share_amounts[i])}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR'
bot.send_message(chat_id=p_user_id, text=my_update_message, parse_mode="MARKDOWNV2") bot.send_message(chat_id=p_user_id, text=my_update_message, parse_mode="MARKDOWNV2")
else: else:
send_to_user("No shares found for your account. Check " + os.getenv("WEBSITE_URL") + " to change your settings and add shares.", pUser_id=p_user_id) send_to_user("No shares found for your account. Check " + os.getenv("APP_URL") + " to change your settings and add shares.", pUser_id=p_user_id)
if len(shares) != 0: # Send updates on watchlist shares if existing if len(shares) != 0: # Send updates on watchlist shares if existing
send_to_user("Your watchlist shares:", pUser_id=p_user_id) send_to_user("Your watchlist shares:", pUser_id=p_user_id)

View File

@@ -2,7 +2,7 @@ pyTelegramBotAPI~=4.5.0
Markdown~=3.3.6 Markdown~=3.3.6
newsapi-python~=0.2.6 newsapi-python~=0.2.6
python-dotenv~=0.20.0 python-dotenv~=0.20.0
requests~=2.27.1 requests~=2.28.1
APScheduler~=3.9.1 APScheduler~=3.9.1
croniter~=1.3.4 croniter~=1.3.4
tzlocal==2.1 tzlocal==2.1