Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add notify as provider #466

Merged
merged 9 commits into from
May 1, 2024
Merged

add notify as provider #466

merged 9 commits into from
May 1, 2024

Conversation

K0IN
Copy link
Contributor

@K0IN K0IN commented Dec 25, 2023

PR for: #465

Open demo instance and subscribe, then run the code:

from notifiers import get_notifier
p = get_notifier('notify')
print(p.required)
res = p.notify(title='test', message='test', base_url='https://notify-demo.deno.dev', tags=['test'])
print(res)

a local test instance can be hosted like so (warning, hardcoded key):

docker run -p 8787:8787 -e VAPID_KEY=eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2IiwiYWxnIjoiRVMyNTYiLCJ4IjoiMGh4bURpNmRIWkJFQmx3MmZBOTVka09mNktSSHllc2NRb3JNV2dMNGR6TSIsInkiOiJCZnNYZ2tnMW9iWHMybmpmTWRyMmVDZ1FPZmFoVWE3WWtWczFuVzdfeWxVIiwiZCI6Ind4X3N5TmFkSFZ3OHhHOExVQzJhcWF2OG8zZVlQWEtVRmdEdDFDNm80b1UiLCJrZXlfb3BzIjpbInNpZ24iXSwiZXh0Ijp0cnVlfQ== -e SUB=mailto:[email protected] -e SENDKEY=mypassword ghcr.io/k0in/notify:latest

Where token must be set to "mypassword".

from notifiers import get_notifier
p = get_notifier('notify')
print(p.required)
res = p.notify(title='test', message='test', base_url='http://localhost:8787', tags=['test'], token="mypassword")
print(res)

@K0IN
Copy link
Contributor Author

K0IN commented Dec 26, 2023

@liiight can you point me into the right direction on what files I need to update as well?

@K0IN K0IN marked this pull request as ready for review December 27, 2023 18:31
@liiight
Copy link
Owner

liiight commented Apr 29, 2024

Run pre-commit run -a locally and then commit and push again

K0IN added 3 commits April 29, 2024 21:47
* Add sanity test
* Fix documentation
@liiight liiight merged commit 080b2a8 into liiight:main May 1, 2024
2 checks passed
@liiight
Copy link
Owner

liiight commented May 1, 2024

thanks for this!

loonghao pushed a commit to loonghao/notifiers that referenced this pull request Dec 9, 2024
* add notify as provider

* Update notify.py

* Fix format
* remove unused imports

* Upate import order

* Update import order

* Add notify to readme

* Add documentation for Notify

* Update test_notify.py

* Fix formating

* Remove unused import

* Add tests

* Add sanity test
* Fix documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants