mastodonapi.php aktualisiert

This commit is contained in:
simonpipe 2025-08-09 15:05:19 +02:00
parent e8bbeef9f7
commit 6cd0d9efca

View file

@ -1,26 +1,22 @@
<?php <?php
// MastodonAPI extension for Datenstrom Yellow // MastodonRSS extension, https://codeberg.org/simonpipe/yellow-mastodonrss
// Based on MastodonRSS extension by Simon Pipe, adapted for Mastodon API
// https://codeberg.org/simonpipe/yellow-mastodonapi/src/branch/main
class YellowMastodonAPI { // Klasse umbenannt zu MastodonAPI class YellowMastodonAPI {
const VERSION = "1.0"; // Version erhöht, da größere Änderungen const VERSION = "0.1";
public $yellow; public $yellow;
// Handle initialisation // Handle initialisation
public function onLoad($yellow) { public function onLoad($yellow) {
$this->yellow = $yellow; $this->yellow = $yellow;
// NEUE KONFIGURATION FÜR DIE API
$this->yellow->system->setDefault("mastodonapiInstanceUrl", "https://mastodon.social"); // Deine Mastodon Instanz-URL $this->yellow->system->setDefault("mastodonapiInstanceUrl", "https://mastodon.social"); // Deine Mastodon Instanz-URL
$this->yellow->system->setDefault("mastodonapiUserId", ""); // Deine Mastodon User ID (numerisch, z.B. 1234567890) $this->yellow->system->setDefault("mastodonapiUserId", ""); // Deine Mastodon User ID (numerisch, z.B. 1234567890)
$this->yellow->system->setDefault("mastodonapiAccessToken", ""); // Optional: Dein persönlicher API-Token (read:statuses) $this->yellow->system->setDefault("mastodonapiAccessToken", ""); // Optional: Dein persönlicher API-Token (read:statuses)
$this->yellow->system->setDefault("mastodonapiHashtag", "");
$this->yellow->system->setDefault("mastodonapiHashtag", ""); // Umbenannt von mastodonrssHashtag zu mastodonapiHashtag $this->yellow->system->setDefault("mastodonapiAuthor", "YellowUser");
$this->yellow->system->setDefault("mastodonapiAuthor", "YellowUser"); // Umbenannt $this->yellow->system->setDefault("mastodonapiTag", "Fediverse");
$this->yellow->system->setDefault("mastodonapiTag", "Fediverse"); // Umbenannt $this->yellow->system->setDefault("mastodonapiFolder", "content/1-blog/");
$this->yellow->system->setDefault("mastodonapiFolder", "content/1-blog/"); // Umbenannt $this->yellow->system->setDefault("mastodonapiTriggerPath", "/mastodonrss-webhook-CHANGE_THIS_SECRET_KEY");
$this->yellow->system->setDefault("mastodonapiTriggerPath", "/mastodonapi-webhook-CHANGE_THIS_SECRET_KEY"); // Umbenannt
} }
// Handle web requests (NUR für den Webhook-Trigger) // Handle web requests (NUR für den Webhook-Trigger)