forked from team/site
1
0
Fork 0

closes #122 - add rss feed for news

This commit is contained in:
Ben Harris 2023-02-24 13:37:17 -05:00
parent e2e0003fc2
commit 0165c59956
4 changed files with 205 additions and 67 deletions

View File

@ -1,6 +1,7 @@
{
"require": {
"tildeteam/wiki": "^2.0",
"mibe/feedwriter": "^1.1",
"ext-openssl": "*",
"ext-json": "*",
"ext-shmop": "*",

237
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "4819cdd6fda4c82d5fb0f50ad5cf3897",
"content-hash": "932fa6699aef88e3be5f372d748d856d",
"packages": [
{
"name": "dflydev/dot-access-data",
"version": "v3.0.1",
"version": "v3.0.2",
"source": {
"type": "git",
"url": "https://github.com/dflydev/dflydev-dot-access-data.git",
"reference": "0992cc19268b259a39e86f296da5f0677841f42c"
"reference": "f41715465d65213d644d3141a6a93081be5d3549"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/0992cc19268b259a39e86f296da5f0677841f42c",
"reference": "0992cc19268b259a39e86f296da5f0677841f42c",
"url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549",
"reference": "f41715465d65213d644d3141a6a93081be5d3549",
"shasum": ""
},
"require": {
@ -28,7 +28,7 @@
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
"scrutinizer/ocular": "1.6.0",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^3.14"
"vimeo/psalm": "^4.0.0"
},
"type": "library",
"extra": {
@ -77,22 +77,22 @@
],
"support": {
"issues": "https://github.com/dflydev/dflydev-dot-access-data/issues",
"source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.1"
"source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2"
},
"time": "2021-08-13T13:06:58+00:00"
"time": "2022-10-27T11:44:00+00:00"
},
{
"name": "league/commonmark",
"version": "2.3.5",
"version": "2.3.9",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257"
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/84d74485fdb7074f4f9dd6f02ab957b1de513257",
"reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c1e114f74e518daca2729ea8c4bf1167038fa4b5",
"reference": "c1e114f74e518daca2729ea8c4bf1167038fa4b5",
"shasum": ""
},
"require": {
@ -112,7 +112,7 @@
"erusev/parsedown": "^1.0",
"ext-json": "*",
"github/gfm": "0.29.0",
"michelf/php-markdown": "^1.4",
"michelf/php-markdown": "^1.4 || ^2.0",
"nyholm/psr7": "^1.5",
"phpstan/phpstan": "^1.8.2",
"phpunit/phpunit": "^9.5.21",
@ -120,7 +120,7 @@
"symfony/finder": "^5.3 | ^6.0",
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0",
"unleashedtech/php-coding-standard": "^3.1.1",
"vimeo/psalm": "^4.24.0"
"vimeo/psalm": "^4.24.0 || ^5.0.0"
},
"suggest": {
"symfony/yaml": "v2.3+ required if using the Front Matter extension"
@ -185,20 +185,20 @@
"type": "tidelift"
}
],
"time": "2022-07-29T10:59:45+00:00"
"time": "2023-02-15T14:07:24+00:00"
},
{
"name": "league/config",
"version": "v1.1.1",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/config.git",
"reference": "a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e"
"reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/config/zipball/a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e",
"reference": "a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e",
"url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3",
"reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3",
"shasum": ""
},
"require": {
@ -207,7 +207,7 @@
"php": "^7.4 || ^8.0"
},
"require-dev": {
"phpstan/phpstan": "^0.12.90",
"phpstan/phpstan": "^1.8.2",
"phpunit/phpunit": "^9.5.5",
"scrutinizer/ocular": "^1.8.1",
"unleashedtech/php-coding-standard": "^3.1",
@ -267,7 +267,108 @@
"type": "github"
}
],
"time": "2021-08-14T12:15:32+00:00"
"time": "2022-12-11T20:36:23+00:00"
},
{
"name": "mibe/feedwriter",
"version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/mibe/FeedWriter.git",
"reference": "f4cc748ad8700e36663f08cfeebe7fd39b00eea2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mibe/FeedWriter/zipball/f4cc748ad8700e36663f08cfeebe7fd39b00eea2",
"reference": "f4cc748ad8700e36663f08cfeebe7fd39b00eea2",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"FeedWriter\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0"
],
"authors": [
{
"name": "Michael Bemmerl",
"email": "mail@mx-server.de"
},
{
"name": "Phil Freo"
},
{
"name": "Paul Ferrett"
},
{
"name": "Brennen Bearnes"
},
{
"name": "Michael Robinson",
"email": "mike@pagesofinterest.net"
},
{
"name": "Baptiste Fontaine"
},
{
"name": "Kristián Valentín"
},
{
"name": "Brandtley McMinn"
},
{
"name": "Julian Bogdani"
},
{
"name": "Anis Uddin Ahmad",
"email": "anis.programmer@gmail.com"
},
{
"name": "Cedric Gampert"
},
{
"name": "Yamek"
},
{
"name": "thielj"
},
{
"name": "Pavel Khakhlou"
},
{
"name": "Daniel"
},
{
"name": "Tino Goratsch"
}
],
"description": "Generate feeds in either RSS 1.0, RSS 2.0 or ATOM formats",
"homepage": "https://github.com/mibe/FeedWriter",
"keywords": [
"RSS 1.0",
"atom",
"feed",
"rss",
"rss 2.0",
"rss2"
],
"support": {
"issues": "https://github.com/mibe/FeedWriter/issues",
"source": "https://github.com/mibe/FeedWriter/tree/master"
},
"time": "2016-11-19T20:47:44+00:00"
},
{
"name": "mnapoli/front-yaml",
@ -308,25 +409,25 @@
},
{
"name": "nette/schema",
"version": "v1.2.2",
"version": "v1.2.3",
"source": {
"type": "git",
"url": "https://github.com/nette/schema.git",
"reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df"
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df",
"reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df",
"url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
"reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f",
"shasum": ""
},
"require": {
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
"php": ">=7.1 <8.2"
"php": ">=7.1 <8.3"
},
"require-dev": {
"nette/tester": "^2.3 || ^2.4",
"phpstan/phpstan-nette": "^0.12",
"phpstan/phpstan-nette": "^1.0",
"tracy/tracy": "^2.7"
},
"type": "library",
@ -364,34 +465,36 @@
],
"support": {
"issues": "https://github.com/nette/schema/issues",
"source": "https://github.com/nette/schema/tree/v1.2.2"
"source": "https://github.com/nette/schema/tree/v1.2.3"
},
"time": "2021-10-15T11:40:02+00:00"
"time": "2022-10-13T01:24:26+00:00"
},
{
"name": "nette/utils",
"version": "v3.2.8",
"version": "v4.0.0",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368"
"reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
"reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368",
"url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e",
"reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e",
"shasum": ""
},
"require": {
"php": ">=7.2 <8.3"
"php": ">=8.0 <8.3"
},
"conflict": {
"nette/di": "<3.0.6"
"nette/finder": "<3",
"nette/schema": "<1.2.2"
},
"require-dev": {
"nette/tester": "~2.0",
"jetbrains/phpstorm-attributes": "dev-master",
"nette/tester": "^2.4",
"phpstan/phpstan": "^1.0",
"tracy/tracy": "^2.3"
"tracy/tracy": "^2.9"
},
"suggest": {
"ext-gd": "to use Image",
@ -405,7 +508,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.2-dev"
"dev-master": "4.0-dev"
}
},
"autoload": {
@ -449,9 +552,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v3.2.8"
"source": "https://github.com/nette/utils/tree/v4.0.0"
},
"time": "2022-09-12T23:36:20+00:00"
"time": "2023-02-02T10:41:53+00:00"
},
{
"name": "psr/event-dispatcher",
@ -505,16 +608,16 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v3.1.1",
"version": "v3.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918"
"reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
"reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3",
"reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3",
"shasum": ""
},
"require": {
@ -523,7 +626,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.1-dev"
"dev-main": "3.3-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -552,7 +655,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1"
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0"
},
"funding": [
{
@ -568,20 +671,20 @@
"type": "tidelift"
}
],
"time": "2022-02-25T11:15:52+00:00"
"time": "2022-11-25T10:21:52+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.26.0",
"version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4"
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
"reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
"shasum": ""
},
"require": {
@ -596,7 +699,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -634,7 +737,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
},
"funding": [
{
@ -650,20 +753,20 @@
"type": "tidelift"
}
],
"time": "2022-05-24T11:49:31+00:00"
"time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.26.0",
"version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace"
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace",
"reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936",
"shasum": ""
},
"require": {
@ -672,7 +775,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -717,7 +820,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0"
},
"funding": [
{
@ -733,20 +836,20 @@
"type": "tidelift"
}
],
"time": "2022-05-10T07:21:04+00:00"
"time": "2022-11-03T14:55:06+00:00"
},
{
"name": "symfony/yaml",
"version": "v6.1.4",
"version": "v6.2.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919"
"reference": "2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/86ee4d8fa594ed45e40d86eedfda1bcb66c8d919",
"reference": "86ee4d8fa594ed45e40d86eedfda1bcb66c8d919",
"url": "https://api.github.com/repos/symfony/yaml/zipball/2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19",
"reference": "2bbfbdacc8a15574f8440c4838ce0d7bb6c86b19",
"shasum": ""
},
"require": {
@ -791,7 +894,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v6.1.4"
"source": "https://github.com/symfony/yaml/tree/v6.2.5"
},
"funding": [
{
@ -807,7 +910,7 @@
"type": "tidelift"
}
],
"time": "2022-08-02T16:17:38+00:00"
"time": "2023-01-10T18:53:53+00:00"
},
{
"name": "tildeteam/wiki",

32
news/feed.php Normal file
View File

@ -0,0 +1,32 @@
<?php
require_once __DIR__ .'/../vendor/autoload.php';
use FeedWriter\ATOM;
use tildeteam\wiki;
$feed = new ATOM();
$parser = wiki::factory();
$feed->setTitle("tilde.team news");
$feed->setLink("https://tilde.team/news/");
$feed->setDescription("updates and news for tilde.team");
foreach (glob("pages/*.md") as $page)
{
$file = $parser->parse(file_get_contents($page));
$yaml = $file->getYAML();
if (!$yaml["published"]) continue;
$item = $feed->createNewItem();
$item->setTitle($yaml["title"]);
$item->setLink("https://tilde.team/news/" . basename($page, ".md"));
$item->setDate($yaml["date"]);
$item->setContent($file->getContent());
$feed->addItem($item);
}
$feed->printFeed();

View File

@ -30,6 +30,8 @@ if (!isset($_GET["page"]) || !file_exists("pages/{$_GET['page']}.md")) {
<a href="https://tildegit.org/team/site/src/branch/master/news">source</a> and open a PR!
</p>
<p>also available as a <a href="feed.php">feed</a></p>
<hr>
<h3>updates:</h3>