Upload files to "/"

This commit is contained in:
simonpipe 2026-05-28 08:14:03 +02:00
parent e37663e566
commit 1b7a3e0198
4 changed files with 135 additions and 0 deletions

27
LICENSE Normal file
View file

@ -0,0 +1,27 @@
UNLICENSE
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org/>
and licensed under GPL version 2, unless stated otherwise.

6
gitattributes Normal file
View file

@ -0,0 +1,6 @@
.gitattributes export-ignore
LICENSE export-ignore
help-gotoso*.md export-ignore
readme*.md export-ignore
# Auto detect text files and perform LF normalization
* text=auto

51
readme-de.md Normal file
View file

@ -0,0 +1,51 @@
<p align="right"><a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/readme-de.md">Deutsch</a> &nbsp; <a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/readme.md">English</a></p>
# Mastodonapi 0.9.8
Importiere deine Toots in deinen Blog. Getestet mit <a href="https://comam.es/what-is-snac">Snac</a>.
## Installation
<a href="https://codeberg.org/simonpipe/yellow-mastodonapi/archive/main.zip">Lade die ZIP-Datei herunter</a> und kopiere sie in deinen system/extensions Ordner. <a target="blank_" href="https://github.com/annaesvensson/yellow-update">Erfahre mehr über Erweiterungen</a>.
## Funktionsweise
Das Plugin arbeitet vollautomatisch. Es prüft im Hintergrund regelmäßig, ob neue Beiträge vorhanden sind.
Wenn du die Seite besuchst, fragt es deine Mastodon-API ab und erstellt automatisch Blog-Beiträge aus deinen Toots. Optional kannst du einen #Hashtag angeben, um nur bestimmte Beiträge zu importieren.
Es gibt drei Möglichkeiten, den Import auszulösen:
1. **Automatisch (Lazy Cron):** Sobald ein Besucher deine Website aufruft, prüft das Plugin, ob das Update-Intervall abgelaufen ist und lädt bei Bedarf neue Toots.
2. **Über das Terminal:** Du kannst den Import manuell auf dem Server starten mit: php yellow.php mastodonapi
3. **Über den System-Cronjob:** Falls dein Host Cronjobs unterstützt, kannst du den Befehl php yellow.php mastodonapi regelmäßig ausführen lassen (z. B. alle 30 Minuten).
## Einstellungen
Alle Einstellungen befinden sich in `system/extensions/yellow-system.ini`:
`MastodonapiInstanceUrl` = deine Mastodon Instanz-URL (z. B. https://mastodon.social)
`MastodonapiAccountId` = deine Mastodon User-ID (numerisch, z. B. 1234567890)
*Finde die ID eines Snac oder Mastodon Accounts: Gib "https://DEINE_INSTANZ_URL/api/v1/accounts/lookup?acct=PROFILNAME" in deinen Browser ein.*
*Finde die ID eines GoToSocial-Accounts <a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/help-de.md">(siehe hier)</a>*
`MastodonapiAccessToken` = optional für einen Mastodon-Account, zwingend für einen GoToSocial-Account <a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/help-de.md">(siehe hier)</a>
`MastodonapiUpdateInterval` = Zeitintervall zwischen automatischen Updates in Minuten (Standard: 30)
`MastodonapiLimit` = Anzahl der Toots, die pro Durchgang abgerufen werden (Standard: 20)
`MastodonapiHashtag` = leer lassen für alle Beiträge; oder mit #hashtag filtern
`MastodonapiAuthor` = Name, unter dem die Blog-Beiträge erscheinen sollen
`MastodonapiTag` = Tag für die Blog-Beiträge (Standard: Fediverse)
`MastodonapiFolder` = Pfad zum Blog-Ordner (Standard: content/2-blog/)
`MastodonapiMaxAge` = Alter der Toots in Stunden, die noch importiert werden sollen. 0 = alle verfügbaren Toots
`MastodonapiStatus` = Seitenstatus, Standardwert ist public
Die folgenden Status-Werte werden unterstützt:
`public` = Seite ist eine normale Seite
`draft` = Seite ist nicht sichtbar, Benutzer muss eingeloggt sein, erfordert die <a target="blank_" href="https://github.com/annaesvensson/yellow-draft">Draft-Erweiterung</a>
`unlisted` = Seite ist nicht sichtbar, kann aber mit dem richtigen Link aufgerufen werden
## Entwickler
Simon Rohr

51
readme.md Normal file
View file

@ -0,0 +1,51 @@
<p align="right"><a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/readme-de.md">Deutsch</a> &nbsp; <a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/readme.md">English</a></p>
# Mastodonapi 0.9.8
Import your toots into your blog. Tested with <a href="https://comam.es/what-is-snac">Snac</a>.
## Installation
<a href="https://codeberg.org/simonpipe/yellow-mastodonapi/archive/main.zip">Download ZIP file</a> and copy it into your `system/extensions` folder. <a target="blank_" href="https://github.com/annaesvensson/yellow-update">Learn more about extensions</a>.
## How to
The plugin works fully automatically. It regularly checks in the background if there are new posts.
When you visit the site, it queries your Mastodon API and automatically creates blog posts from your Toots. Optionally, you can specify a #Hashtag to import only certain posts.
There are three ways to trigger the import:
1. **Automatic (Lazy Cron):** As soon as a visitor accesses your website, the plugin checks if the update interval has expired and loads new Toots if necessary.
2. **From the terminal:** You can manually start the import on the server with: `php yellow.php mastodonapi`
3. **From the system cronjob:** If your host supports cronjobs, you can have the command `php yellow.php mastodonapi` run regularly (e.g. every 30 minutes).
## Settings
All settings are in `system/extensions/yellow-system.ini`:
`MastodonapiInstanceUrl` = your Mastodon instance URL (e.g. https://mastodon.social)
`MastodonapiAccountId` = your Mastodon user ID (numeric, e.g. 1234567890)
*Find the ID of a Snac or Mastodon account: Enter "https://YOUR_INSTANCE_URL/api/v1/accounts/lookup?acct=PROFILNAME" in your browser.*
*Find the ID of a GoToSocial account <a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/help-en.md">(see here)</a>*
`MastodonapiAccessToken` = optional for a Mastodon account, mandatory for a GoToSocial account <a href="https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main/help-en.md">(see here)</a>
`MastodonapiUpdateInterval` = time interval between automatic updates in minutes (default: 30)
`MastodonapiLimit` = number of Toots retrieved per run (default: 20)
`MastodonapiHashtag` = leave blank for all posts; or filter with #hashtag
`MastodonapiAuthor` = name under which the blog posts should appear
`MastodonapiTag` = tag for the blog posts (default: Fediverse)
`MastodonapiFolder` = path to the blog folder (default: content/2-blog/)
`MastodonapiMaxAge` = age of Toots in hours that should still be imported. 0 = all available Toots
`MastodonapiStatus` = page status, default value is public
The following status values are supported:
`public` = page is a normal page
`draft` = page is not visible, user needs to log in, requires <a target="blank_" href="https://github.com/annaesvensson/yellow-draft">draft extension</a>
`unlisted` = page is not visible, but can be accessed with the correct link
## Developer
Simon Rohr