writefreely_to_gemini/README.md
2026-01-07 02:09:27 +00:00

22 lines
997 B
Markdown

# writefreely to gemini
This is a quickly hacked PHP script that will get the latests posts in your sqlite database and create .md and .gmi files to serves as a gemini protocol file. It uses [gemgen](https://sr.ht/~kota/gemgen/) command line for the markdown to gemtext translation.
This was created for https://lacra.ia.br/
This just select the date of the most recently updated post. If it is more recent than a stamp file it updates *everything*. Not an issue for a few hundred posts but this might need optimisation in the future if this ever gets used on a larger scale to only update changed posts.
# Usage
Edit config.php and put something like this in your cron tab
```
5 * * * * cd /home/lacraia/writefreely_to_gemini && php -f update_gmi_content.php > /home/lacraia/logs/gmi_update.log 2>&1
```
# License
Please do what the fuck you want with this.
# Comments ?
Message me on the [fediverse](https://gone.lema.org/@santi) or drop me [a mail](mailto:code.writefreely@lema.org)