Add new wrapper for my own website feed

As the feed contains the whole posts.
But mirror in fediverse should only contain title.
This commit is contained in:
Daniel Siepmann 2024-03-05 19:38:42 +01:00
parent 08886e6290
commit b396925dda
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
5 changed files with 8051 additions and 0 deletions

View file

@ -2,6 +2,7 @@
use DanielSiepmann\FediverseFeedWrappers\RequestHandler; use DanielSiepmann\FediverseFeedWrappers\RequestHandler;
use DanielSiepmann\FediverseFeedWrappers\WrapperRegistry; use DanielSiepmann\FediverseFeedWrappers\WrapperRegistry;
use DanielSiepmann\FediverseFeedWrappers\Wrapper\DanielSiepmannTypo3;
use DanielSiepmann\FediverseFeedWrappers\Wrapper\Frontpage; use DanielSiepmann\FediverseFeedWrappers\Wrapper\Frontpage;
use DanielSiepmann\FediverseFeedWrappers\Wrapper\GitHubTypo3; use DanielSiepmann\FediverseFeedWrappers\Wrapper\GitHubTypo3;
@ -11,5 +12,6 @@ require_once __DIR__ . '/../vendor/autoload.php';
new WrapperRegistry([ new WrapperRegistry([
'' => Frontpage::class, '' => Frontpage::class,
'GitHubTypo3' => GitHubTypo3::class, 'GitHubTypo3' => GitHubTypo3::class,
'DanielSiepmannTypo3' => DanielSiepmannTypo3::class,
]) ])
))->handleRequest(); ))->handleRequest();

View file

@ -0,0 +1,63 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2023 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
namespace DanielSiepmann\FediverseFeedWrappers\Wrapper;
use DOMDocument;
use DanielSiepmann\FediverseFeedWrappers\WrapperInterface;
class DanielSiepmannTypo3 implements WrapperInterface
{
private string $url;
public function __construct(
string $url = 'https://daniel-siepmann.de/rss-feed/blog-posts/typo3.xml'
) {
$this->url = $url;
}
public function contentType(): string
{
return 'application/xml';
}
/**
* We don't want the full blog post within each feed item.
*
* Instead we are only interested in title.
* Interested people can head over to the actual URL for full info.
*/
public function content(): string
{
$content = new DOMDocument();
$content->loadXML(file_get_contents($this->url));
foreach ($content->getElementsByTagName('item') as $entry) {
// Remove content (body in friendica), title will become body within friendica
$descriptionNode = $entry->getElementsByTagName('description')[0];
$descriptionNode->parentNode->removeChild($descriptionNode);
}
return $content->saveXML();
}
}

View file

@ -0,0 +1,493 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>Daniel Siepmann - Coding is Art - Blog Posts typo3</title>
<description>List of typo3 blog posts at daniel-siepmann.de</description>
<link>https://daniel-siepmann.de/filtered-blog-posts/topic/typo3.html</link>
<atom:link href="https://daniel-siepmann.de/rss-feed/blog-posts/typo3.xml" rel="self" type="application/rss+xml"/>
<lastBuildDate>Tue, 05 Mar 2024 19:00:04 +0100</lastBuildDate>
<ttl>1800</ttl>
<item>
<title>Recap Web Camp Venlo 2024</title>
<link>https://daniel-siepmann.de/recap-web-camp-venlo-2024.html</link>
<pubDate>Sun, 03 Mar 2024 17:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/recap-web-camp-venlo-2024.html</guid>
</item>
<item>
<title>TYPO3 Composer Best Practices</title>
<link>https://daniel-siepmann.de/typo3-composer-best-practices.html</link>
<pubDate>Wed, 20 Dec 2023 08:31:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-composer-best-practices.html</guid>
</item>
<item>
<title>TypeScript with Modules lacking Types</title>
<link>https://daniel-siepmann.de/typescript-with-modules-lacking-types.html</link>
<pubDate>Wed, 15 Nov 2023 09:19:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typescript-with-modules-lacking-types.html</guid>
</item>
<item>
<title>Import Data within TYPO3</title>
<link>https://daniel-siepmann.de/import-data-within-typo3.html</link>
<pubDate>Wed, 20 Sep 2023 11:19:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/import-data-within-typo3.html</guid>
</item>
<item>
<title>My TYPO3 Journey</title>
<link>https://daniel-siepmann.de/my-typo3-journey.html</link>
<pubDate>Wed, 12 Jul 2023 17:34:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/my-typo3-journey.html</guid>
</item>
<item>
<title>Auto migrate PHP code via configuration</title>
<link>https://daniel-siepmann.de/auto-migrate-php-code-via-configuration.html</link>
<pubDate>Wed, 28 Jun 2023 14:17:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/auto-migrate-php-code-via-configuration.html</guid>
</item>
<item>
<title>Missing Motivation to Blog</title>
<link>https://daniel-siepmann.de/missing-motivation-to-blog.html</link>
<pubDate>Fri, 23 Jun 2023 09:43:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/missing-motivation-to-blog.html</guid>
</item>
<item>
<title>TYPO3 Update</title>
<link>https://daniel-siepmann.de/typo3-update.html</link>
<pubDate>Mon, 05 Jun 2023 11:02:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-update.html</guid>
</item>
<item>
<title>TYPO3 show additional information in dropdown</title>
<link>https://daniel-siepmann.de/typo3-show-additional-information-in-dropdown.html</link>
<pubDate>Tue, 17 Jan 2023 08:08:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-show-additional-information-in-dropdown.html</guid>
</item>
<item>
<title>TYPO3 Fediverse Accounts</title>
<link>https://daniel-siepmann.de/typo3-fediverse-news-accounts.html</link>
<pubDate>Sun, 08 Jan 2023 16:17:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-fediverse-news-accounts.html</guid>
</item>
<item>
<title>TYPO3 RTE for Input Fields</title>
<link>https://daniel-siepmann.de/typo3-rte-for-input-fields.html</link>
<pubDate>Tue, 08 Nov 2022 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-rte-for-input-fields.html</guid>
</item>
<item>
<title>Use supported PHP Versions</title>
<link>https://daniel-siepmann.de/use-supported-php-versions.html</link>
<pubDate>Mon, 22 Aug 2022 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/use-supported-php-versions.html</guid>
</item>
<item>
<title>Mock Guzzle Requests in Functional Tests</title>
<link>https://daniel-siepmann.de/mock-guzzle-requests-in-functional-tests.html</link>
<pubDate>Fri, 08 Jul 2022 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/mock-guzzle-requests-in-functional-tests.html</guid>
</item>
<item>
<title>TYPO3 Content with Solr Usable by Editors</title>
<link>https://daniel-siepmann.de/typo3-content-with-solr-usable-by-editors.html</link>
<pubDate>Fri, 01 Apr 2022 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-content-with-solr-usable-by-editors.html</guid>
</item>
<item>
<title>TypoScript outside of Frontend context</title>
<link>https://daniel-siepmann.de/typoscript-outside-of-frontend-context.html</link>
<pubDate>Wed, 24 Mar 2021 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typoscript-outside-of-frontend-context.html</guid>
</item>
<item>
<title>Concrete TYPO3 Dependency Injection examples</title>
<link>https://daniel-siepmann.de/concrete-typo3-dependency-injection-examples.html</link>
<pubDate>Wed, 24 Feb 2021 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/concrete-typo3-dependency-injection-examples.html</guid>
</item>
<item>
<title>Prepare legacy code for upcoming TYPO3 versions</title>
<link>https://daniel-siepmann.de/prepare-legacy-code-for-upcoming-typo3-versions.html</link>
<pubDate>Tue, 26 Jan 2021 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/prepare-legacy-code-for-upcoming-typo3-versions.html</guid>
</item>
<item>
<title>Reuse existing Extbase controller</title>
<link>https://daniel-siepmann.de/reuse-existing-extbase-controller.html</link>
<pubDate>Sat, 24 Oct 2020 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/reuse-existing-extbase-controller.html</guid>
</item>
<item>
<title>feedit bugfix 10.0.2 released</title>
<link>https://daniel-siepmann.de/feedit-bugfix-1002-released.html</link>
<pubDate>Fri, 25 Sep 2020 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/feedit-bugfix-1002-released.html</guid>
</item>
<item>
<title>TYPO3 tracking extension</title>
<link>https://daniel-siepmann.de/typo3-tracking-extension.html</link>
<pubDate>Thu, 17 Sep 2020 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-tracking-extension.html</guid>
</item>
<item>
<title>Composer dependency checker</title>
<link>https://daniel-siepmann.de/composer-dependency-checker.html</link>
<pubDate>Wed, 16 Sep 2020 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/composer-dependency-checker.html</guid>
</item>
<item>
<title>Hidden TYPO3 gem EXT:feedit</title>
<link>https://daniel-siepmann.de/hidden-typo3-gem-extfeedit.html</link>
<pubDate>Fri, 20 Mar 2020 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/hidden-typo3-gem-extfeedit.html</guid>
</item>
<item>
<title>TYPO3 v10 feature outlook</title>
<link>https://daniel-siepmann.de/typo3-v10-feature-outlook.html</link>
<pubDate>Tue, 25 Feb 2020 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/typo3-v10-feature-outlook.html</guid>
</item>
<item>
<title>Local mysqldump via SSH Tunnel</title>
<link>https://daniel-siepmann.de/local-mysqldump-via-ssh-tunnel.html</link>
<pubDate>Thu, 30 Jan 2020 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/local-mysqldump-via-ssh-tunnel.html</guid>
</item>
<item>
<title>TYPO3 Plugins as Content Elements</title>
<link>https://daniel-siepmann.de/posts/2019/typo3-plugins-as-content-elements.html</link>
<pubDate>Wed, 13 Nov 2019 22:31:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2019/typo3-plugins-as-content-elements.html</guid>
</item>
<item>
<title>TYPO3 content caching</title>
<link>https://daniel-siepmann.de/posts/2019/typo3-content-caching.html</link>
<pubDate>Fri, 04 Jan 2019 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2019/typo3-content-caching.html</guid>
</item>
<item>
<title>Configure page UIDs for all content elements in TYPO3</title>
<link>https://daniel-siepmann.de/posts/2018/configure-page-uids-for-all-content-elements-in-typo3.html</link>
<pubDate>Mon, 24 Dec 2018 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2018/configure-page-uids-for-all-content-elements-in-typo3.html</guid>
</item>
<item>
<title>How to use mbox with TYPO3 CMS</title>
<link>https://daniel-siepmann.de/posts/2018/how-to-use-mbox-with-typo3-cms.html</link>
<pubDate>Mon, 05 Nov 2018 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2018/how-to-use-mbox-with-typo3-cms.html</guid>
</item>
<item>
<title>Auto login for TYPO3 Backend during development</title>
<link>https://daniel-siepmann.de/posts/2018/auto-login-for-typo3-backend-during-development.html</link>
<pubDate>Wed, 25 Jul 2018 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2018/auto-login-for-typo3-backend-during-development.html</guid>
</item>
<item>
<title>Executing TYPO3 acceptance tests</title>
<link>https://daniel-siepmann.de/posts/2018/executing-typo3-acceptance-tests.html</link>
<pubDate>Fri, 08 Jun 2018 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2018/executing-typo3-acceptance-tests.html</guid>
</item>
<item>
<title>Integrate TYPO3 Linting with GitLab-CI</title>
<link>https://daniel-siepmann.de/posts/2018/integrate-typo3-linting-with-gitlab-ci.html</link>
<pubDate>Tue, 30 Jan 2018 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2018/integrate-typo3-linting-with-gitlab-ci.html</guid>
</item>
<item>
<title>Integrate TypoScript linter into VIM</title>
<link>https://daniel-siepmann.de/posts/2018/integrate-typoscript-linter-into-vim.html</link>
<pubDate>Sun, 28 Jan 2018 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2018/integrate-typoscript-linter-into-vim.html</guid>
</item>
<item>
<title>Use Whoops as Exception handler for TYPO3</title>
<link>https://daniel-siepmann.de/posts/2017/use-whoops-as-exception-handler-for-typo3.html</link>
<pubDate>Fri, 17 Nov 2017 00:00:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2017/use-whoops-as-exception-handler-for-typo3.html</guid>
</item>
<item>
<title>How to create TYPO3 Form select element with options selected from database</title>
<link>https://daniel-siepmann.de/posts/2017/how-to-create-typo3-form-select-element-with-options-selected-from-database.html</link>
<pubDate>Thu, 07 Sep 2017 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2017/how-to-create-typo3-form-select-element-with-options-selected-from-database.html</guid>
</item>
<item>
<title>How to crypt submitted values using a custom finisher in TYPO3 CMS 8</title>
<link>https://daniel-siepmann.de/posts/2017/how-to-crypt-submitted-values-using-a-custom-finisher-in-typo3-cms-8.html</link>
<pubDate>Sat, 26 Aug 2017 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2017/how-to-crypt-submitted-values-using-a-custom-finisher-in-typo3-cms-8.html</guid>
</item>
<item>
<title>TYPO3 (Extbase) Injection</title>
<link>https://daniel-siepmann.de/posts/2017/typo3-extbase-injection.html</link>
<pubDate>Thu, 17 Aug 2017 00:00:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2017/typo3-extbase-injection.html</guid>
</item>
<item>
<title>Using PHP_CodeSniffer for automated code migrations</title>
<link>https://daniel-siepmann.de/posts/2017/using-php-codesniffer-for-automated-code-migrations.html</link>
<pubDate>Mon, 20 Mar 2017 15:21:00 +0100</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/2017/using-php-codesniffer-for-automated-code-migrations.html</guid>
</item>
<item>
<title>Build TYPO3 Language Menu without the need of optionSplit</title>
<link>https://daniel-siepmann.de/posts/migrated/build-typo3-language-menu-without-the-need-of-optionsplit.html</link>
<pubDate>Fri, 09 Sep 2016 16:41:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/migrated/build-typo3-language-menu-without-the-need-of-optionsplit.html</guid>
</item>
<item>
<title>How to find Hooks in TYPO3</title>
<link>https://daniel-siepmann.de/posts/migrated/how-to-find-hooks-in-typo3.html</link>
<pubDate>Thu, 21 Jul 2016 16:41:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/migrated/how-to-find-hooks-in-typo3.html</guid>
</item>
<item>
<title>Workflow for: Read the docs, Sphinx and Plantuml</title>
<link>https://daniel-siepmann.de/posts/migrated/workflow-for-read-the-docs-sphinx-and-plantuml.html</link>
<pubDate>Sat, 11 Jun 2016 16:48:00 +0200</pubDate>
<guid isPermaLink="true">https://daniel-siepmann.de/posts/migrated/workflow-for-read-the-docs-sphinx-and-plantuml.html</guid>
</item>
</channel>
</rss>

View file

@ -0,0 +1,80 @@
<?php
declare(strict_types=1);
/*
* Copyright (C) 2024 Daniel Siepmann <coding@daniel-siepmann.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
namespace DanielSiepmann\FediverseFeedWrappers\Tests\Unit\Wrapper;
use DanielSiepmann\FediverseFeedWrappers\WrapperInterface;
use DanielSiepmann\FediverseFeedWrappers\Wrapper\DanielSiepmannTypo3;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
#[CoversClass(DanielSiepmannTypo3::class)]
final class DanielSiepmannTypo3Test extends TestCase
{
#[Test]
public function canBeCreated(): void
{
$subject = new DanielSiepmannTypo3();
self::assertInstanceOf(
DanielSiepmannTypo3::class,
$subject
);
}
#[Test]
public function isInstanceOfWrapperInterface(): void
{
$subject = new DanielSiepmannTypo3();
self::assertInstanceOf(
WrapperInterface::class,
$subject
);
}
#[Test]
public function returnsContentType(): void
{
$subject = new DanielSiepmannTypo3();
self::assertSame(
'application/xml',
$subject->contentType()
);
}
#[Test]
public function returnsAdjustedFeed(): void
{
$subject = new DanielSiepmannTypo3(
__DIR__ . '/Fixtures/DanielSiepmannTypo3.rss'
);
self::assertStringEqualsFile(
__DIR__ . '/Assertions/DanielSiepmannTypo3.rss',
$subject->content()
);
}
}

File diff suppressed because one or more lines are too long