Compare commits
3 Commits
36da56f04a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0721ae6691 | |||
| 86e60a8fbc | |||
| 79162961e9 |
91
readme.md
91
readme.md
@@ -1,28 +1,28 @@
|
|||||||
# OSMCal → Mobilizon Importer
|
# OSMCal → Mobilizon Importer
|
||||||
EN: Import events from [OSMCal](https://osmcal.org/) into a Mobilizon group, e.g. `https://rheinneckar.events`.
|
|
||||||
|
EN: Import events from [OSMCal](https://osmcal.org/) into a Mobilizon group, e.g. [rheinneckar.events](https://rheinneckar.events).
|
||||||
|
|
||||||
DE: Importiert Veranstaltungen aus dem OpenStreetMap Calendar nach Mobilizon, filtert sie lokal nach Entfernung um Heidelberg und legt sie als Gruppenveranstaltungen an.
|
DE: Importiert Veranstaltungen aus dem OpenStreetMap Calendar nach Mobilizon, filtert sie lokal nach Entfernung um Heidelberg und legt sie als Gruppenveranstaltungen an.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Features / Funktionen
|
## Features / Funktionen
|
||||||
|
|
||||||
|
EN:
|
||||||
- Fetches German OSMCal events via API
|
- Fetches German OSMCal events via API
|
||||||
Lädt deutsche OSMCal-Veranstaltungen über die API
|
|
||||||
|
|
||||||
- Filters events by radius around Heidelberg
|
- Filters events by radius around Heidelberg
|
||||||
Filtert Veranstaltungen nach Radius um Heidelberg
|
|
||||||
|
|
||||||
- Reads the original description from each event’s `.ics` file
|
- Reads the original description from each event’s `.ics` file
|
||||||
Liest die Originalbeschreibung aus der jeweiligen `.ics`-Datei
|
|
||||||
|
|
||||||
- Imports into Mobilizon via GraphQL
|
- Imports into Mobilizon via GraphQL
|
||||||
Importiert nach Mobilizon per GraphQL
|
|
||||||
|
|
||||||
- Supports Mobilizon group posting
|
- Supports Mobilizon group posting
|
||||||
Unterstützt Veröffentlichung als Mobilizon-Gruppe
|
|
||||||
|
|
||||||
- Avoids duplicate imports using a local state file
|
- Avoids duplicate imports using a local state file
|
||||||
Verhindert doppelte Importe über eine lokale Statusdatei
|
|
||||||
|
DE:
|
||||||
|
- Lädt deutsche OSMCal-Veranstaltungen über die API
|
||||||
|
- Filtert Veranstaltungen nach Radius um Heidelberg
|
||||||
|
- Liest die Originalbeschreibung aus der jeweiligen `.ics`-Datei
|
||||||
|
- Importiert nach Mobilizon per GraphQL
|
||||||
|
- Unterstützt Veröffentlichung als Mobilizon-Gruppe
|
||||||
|
- Verhindert doppelte Importe über eine lokale Statusdatei
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -32,6 +32,7 @@ DE: Importiert Veranstaltungen aus dem OpenStreetMap Calendar nach Mobilizon, fi
|
|||||||
- Mobilizon account
|
- Mobilizon account
|
||||||
- Membership in the target Mobilizon group
|
- Membership in the target Mobilizon group
|
||||||
- OAuth token for the Mobilizon API
|
- OAuth token for the Mobilizon API
|
||||||
|
- Empfehlung: Linux
|
||||||
|
|
||||||
Install dependencies:
|
Install dependencies:
|
||||||
|
|
||||||
@@ -39,25 +40,30 @@ Install dependencies:
|
|||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
pip install requests python-dotenv icalendar
|
pip install requests python-dotenv icalendar
|
||||||
|
```
|
||||||
|
auf dem eigenen Rechner voraussetzungen schaffen
|
||||||
|
|
||||||
|
Verzeichnis erstellen und darin ausführen:
|
||||||
|
|
||||||
#auf dem eigenen Rechner voraussetzungen schaffen
|
|
||||||
#Verzeichnis erstellen und darin ausführen:
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration / Konfiguration
|
## Configuration / Konfiguration
|
||||||
|
|
||||||
Create a .env file:
|
Create a .env file:
|
||||||
|
```
|
||||||
MOBILIZON_INSTANCE="https://rheinneckar.events"
|
MOBILIZON_INSTANCE="https://rheinneckar.events"
|
||||||
MOBILIZON_TOKEN="API token"
|
MOBILIZON_TOKEN="API token"
|
||||||
MOBILIZON_ORGANIZER_ACTOR_ID="profile actor ID"
|
MOBILIZON_ORGANIZER_ACTOR_ID="profile actor ID"
|
||||||
MOBILIZON_ATTRIBUTED_TO_ID="group actor ID"
|
MOBILIZON_ATTRIBUTED_TO_ID="group actor ID"
|
||||||
|
```
|
||||||
|
|
||||||
#The helper script setup-mobilizon.py can create this .env file.
|
The helper script setup-mobilizon.py can create this .env file.
|
||||||
|
|
||||||
|
Mit dem hilfsscript setup-mobilizon.py lässt sich die .env Datei automatisch befüllen.
|
||||||
|
|
||||||
## Usage / Nutzung
|
## Usage / Nutzung
|
||||||
|
|
||||||
@@ -65,53 +71,76 @@ Run the importer:
|
|||||||
```bash
|
```bash
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
./import-osmcal-to-mobilizon.py
|
./import-osmcal-to-mobilizon.py
|
||||||
|
```
|
||||||
Example output:
|
Example output:
|
||||||
|
|
||||||
70 Veranstaltungen aus OSMCal geladen
|
70 Veranstaltungen aus OSMCal geladen
|
||||||
|
|
||||||
9 Veranstaltungen im 15-km-Umkreis um Heidelberg
|
9 Veranstaltungen im 15-km-Umkreis um Heidelberg
|
||||||
|
|
||||||
Fertig. Importiert: 9, übersprungen: 0
|
Fertig. Importiert: 9, übersprungen: 0
|
||||||
|
|
||||||
## Settings / Einstellungen
|
## Settings / Einstellungen
|
||||||
|
|
||||||
Edit these values in import-osmcal-to-mobilizon.py.
|
Edit these values in import-osmcal-to-mobilizon.py.
|
||||||
Diese Werte in dieser Datei anpassen
|
|
||||||
|
Diese Werte in der Datei import-osmcal-to-mobilizon.py anpassen
|
||||||
|
|
||||||
Radius / Radius um die angegebenen Koordinaten
|
Radius / Radius um die angegebenen Koordinaten
|
||||||
|
```
|
||||||
RADIUS_KM = 18.0
|
RADIUS_KM = 18.0
|
||||||
|
```
|
||||||
|
|
||||||
Draft mode / Entwurfsmodus
|
Draft mode / Entwurfsmodus
|
||||||
|
```
|
||||||
DRAFT = True
|
DRAFT = True
|
||||||
|
```
|
||||||
Creates drafts / Veranstaltungen werden als Entwurf veröffentlicht.
|
Creates drafts / Veranstaltungen werden als Entwurf veröffentlicht.
|
||||||
|
|
||||||
|
```
|
||||||
DRAFT = False
|
DRAFT = False
|
||||||
|
```
|
||||||
Publishes directly / Veranstaltungen werden direkt veröffentlicht.
|
Publishes directly / Veranstaltungen werden direkt veröffentlicht.
|
||||||
|
|
||||||
Event duration / Veranstaltungsdauer
|
Event duration / Veranstaltungsdauer
|
||||||
|
```
|
||||||
EVENT_DURATION_HOURS = 3
|
EVENT_DURATION_HOURS = 3
|
||||||
|
```
|
||||||
|
|
||||||
## Duplicate handling / Umgang mit bereits importierten Veranstaltungen
|
## Duplicate handling / Umgang mit bereits importierten Veranstaltungen
|
||||||
|
|
||||||
Imported events are stored in:
|
Imported events are stored in:
|
||||||
|
|
||||||
|
Importierte Veranstaltungen werden in folgender Datei gespeichert:
|
||||||
|
|
||||||
imported-osmcal-events.json
|
imported-osmcal-events.json
|
||||||
|
|
||||||
Veranstaltungen in dieser Datei werden bei einem erneuten Lauf des Skriptes übersprungen.
|
|
||||||
Events listed there are skipped on future runs.
|
Events listed there are skipped on future runs.
|
||||||
|
|
||||||
|
Veranstaltungen in dieser Datei werden bei einem erneuten Lauf des Skriptes übersprungen.
|
||||||
|
|
||||||
Reset for a new test / Zurücksetzen vor einen neuen Lauf:
|
Reset for a new test / Zurücksetzen vor einen neuen Lauf:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo '{}' > imported-osmcal-events.json
|
echo '{}' > imported-osmcal-events.json
|
||||||
|
```
|
||||||
|
|
||||||
Vorher alte Entwürfe oder Events in Mobilizon löschen, sonst entstehen Duplikate.
|
|
||||||
Delete old Mobilizon drafts or events first, otherwise duplicates may be created.
|
Delete old Mobilizon drafts or events first, otherwise duplicates may be created.
|
||||||
|
|
||||||
Notes / Hinweise
|
Vorher alte Entwürfe oder Events in Mobilizon löschen, sonst entstehen Duplikate.
|
||||||
|
|
||||||
DE:
|
## Notes / Hinweise
|
||||||
Bestehende Mobilizon-Events werden nicht aktualisiert.
|
|
||||||
Bestehende Entwürfe werden nicht automatisch veröffentlicht.
|
|
||||||
Wenn DRAFT von True auf False geändert wird, werden bereits importierte Events trotzdem übersprungen.
|
|
||||||
Der Access-Token kann ablaufen und muss dann erneuert werden.
|
|
||||||
|
|
||||||
EN:
|
EN:
|
||||||
Existing Mobilizon events are not updated.
|
- Existing Mobilizon events are not updated.
|
||||||
Existing drafts are not automatically published.
|
- Existing drafts are not automatically published.
|
||||||
If DRAFT is changed from True to False, already imported events are still skipped.
|
- If DRAFT is changed from True to False, already imported events are still skipped.
|
||||||
The access token may expire and then has to be renewed.
|
- The access token may expire and then has to be renewed.
|
||||||
|
- This script has contents generated by ai.
|
||||||
|
|
||||||
|
DE:
|
||||||
|
- Bestehende Mobilizon-Events werden nicht aktualisiert.
|
||||||
|
- Bestehende Entwürfe werden nicht automatisch veröffentlicht.
|
||||||
|
- Wenn DRAFT von True auf False geändert wird, werden bereits importierte Events trotzdem übersprungen.
|
||||||
|
- Der Access-Token kann ablaufen und muss dann erneuert werden.
|
||||||
|
- Dieses Script wurde in Zusammenarbeit mit einer KI erarbeitet.
|
||||||
|
|||||||
Reference in New Issue
Block a user