diff options
| author | horus | 2022-10-31 12:24:35 +0100 |
|---|---|---|
| committer | horus | 2022-10-31 12:24:35 +0100 |
| commit | 3c4aa25af0cd6f56db85d503ab552d39b81b5c17 (patch) | |
| tree | c9e7e8de0be62e7f1389a8c19485a6ca29806497 /views/tools/ghrss/feed.php | |
| parent | f0c30d3bf798d52d5c2b14b0a2a12167ed7c2d72 (diff) | |
| download | moehring-3c4aa25af0cd6f56db85d503ab552d39b81b5c17.tar.gz | |
renamed to things
Diffstat (limited to 'views/tools/ghrss/feed.php')
| -rw-r--r-- | views/tools/ghrss/feed.php | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/views/tools/ghrss/feed.php b/views/tools/ghrss/feed.php deleted file mode 100644 index 7276200..0000000 --- a/views/tools/ghrss/feed.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -use DiDom\Document; -use Suin\RSSWriter\Channel; -use Suin\RSSWriter\Feed; -use Suin\RSSWriter\Item; - -require_once __DIR__ . '/ghrss.db.php'; -require_once __DIR__ . '/vendor/autoload.php'; - -header("content-type: application/rss+xml"); - -if ( isset($_REQUEST["l"]) && "" != $_REQUEST["l"] ) { - $stmt = $db->prepare("SELECT * FROM entry_view WHERE language = ? ORDER BY created_at DESC LIMIT 20;"); - $stmt->execute([$_REQUEST["l"]]); -} else { - $stmt = $db->prepare("SELECT * FROM entry_view WHERE created_at >= NOW() - INTERVAL 2 DAY ORDER BY created_at DESC;"); - $stmt->execute([$_REQUEST["l"]]); -} -$result = $stmt->fetchAll(); - -$feed = new Feed(); - -$channel = new Channel(); -$channel - ->title("GHRSS") - ->description("Trending Repos from Github") - ->url( "https://www.maximilianmoehring.com/tools/ghrss/" ) - ->pubDate(strtotime(date("r", time()))) - ->lastBuildDate(strtotime(date("r", time()))) - ->ttl(5) - ->appendTo($feed); - -foreach($result as $item) { - $item_out = new Item(); - - $item_out - ->title($item["title"]) - ->description( "<p>" . $item["synopsis"] . "<br><em>" . $item["language"] . " / " . $item["update_period"] . " / " . $item["stars"] . " Stars</em></p>" ) - ->url($item["url"]) - ->pubDate(strtotime(date($item["created_at"]))) - ->author($item["owner"]) - ->appendTo($channel); -} - -echo $feed; - |
