helloasso-to-discourse/README.md

39 lines
1.1 KiB
Markdown
Raw Normal View History

2023-03-17 23:47:31 +00:00
# Helloasso to Discourse
This works in two distinct steps: first fetch HelloAsso data, then sync with Discourse.
## Installing
pip install .
## Fetching HelloAsso data
Use the `fetch` subcommand, I use it as is:
$ helloasso-to-discourse fetch "$(pass helloasso-clientid)" "$(pass helloasso-clientsecret)" afpy
this fetches the data of the given organization, here named `afpy`, it creates an `./afpy` file.
## Choosing what to sync
The goal is to sync an HelloAsso event (they call it `forms`) to a Discourse Badge.
First let's discover which events we can use:
$ helloasso-to-discourse list-forms ./afpy
this will list names that can be used for the next step.
## Syncing with Discourse
This step actually assigns badges to Discourse users:
As an example to assign badge number 114 to HelloAsso users having paid for the form named `adhesion-2023-a-l-afpy`:
$ helloasso-to-discourse sync https://discuss.afpy.org "$(pass discuss.afpy.org-api-key)" ./afpy adhesion-2023-a-l-afpy 114
$ helloasso-to-discourse sync https://discuss.afpy.org "$(pass discuss.afpy.org-api-key)" ./afpy pyconfr-2023 113