From 2f21f6071e4ed7c7f7ac8563c7771ff834fb59c2 Mon Sep 17 00:00:00 2001 From: nvpie exozyme Date: Sun, 25 Jun 2023 12:54:54 +0000 Subject: [PATCH] first commit --- index.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ parse_rss.php | 43 +++++++++++++++++++++++++++++ style.css | 67 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 185 insertions(+) create mode 100644 index.php create mode 100644 parse_rss.php create mode 100644 style.css diff --git a/index.php b/index.php new file mode 100644 index 0000000..6490465 --- /dev/null +++ b/index.php @@ -0,0 +1,75 @@ + + + + RSS Feed Reader + + + + + + + +

RSS Feeds Reader

+ + + +
+ + + diff --git a/parse_rss.php b/parse_rss.php new file mode 100644 index 0000000..e8b8c91 --- /dev/null +++ b/parse_rss.php @@ -0,0 +1,43 @@ +channel->title; + $feeds = array(); + + foreach ($feed->channel->item as $item) { + $title = (string) $item->title; + $date = (string) $item->pubDate; + $content = (string) $item->description; + + $feeds[] = array( + 'title' => $title, + 'date' => $date, + 'content' => $content + ); + } + + $response = array( + 'success' => true, + 'feedTitle' => $feedTitle, + 'feeds' => $feeds + ); + } else { + $response = array( + 'success' => false, + 'message' => 'Failed to parse RSS feed.' + ); + } +} else { + $response = array( + 'success' => false, + 'message' => 'Invalid request.' + ); +} + +header('Content-Type: application/json'); +echo json_encode($response); +?> + diff --git a/style.css b/style.css new file mode 100644 index 0000000..b326c39 --- /dev/null +++ b/style.css @@ -0,0 +1,67 @@ +body { + font-family: "JetBrains Mono", system-ui, sans-serif; + font-size: 1.01rem; + line-height: 1.4; + color: white; + position: relative; + background: #0f0d11; + max-width: 64em; /* remove this for a full-width layout */ + margin: 0 auto; /* centers the layout */ +} + + + +h1 { + margin: 16px 29px 12px; + color: #F5DF50; +} + +input { + margin: 16px 29px 12px; + padding: 10px; + border: 1px solid #F5DF50; + background: bottom; + color: #4CAF50; + outline: none; +} + +input:focus { + border-color:#F5DF50; + border-width:2px; + box-shadow:0 0 15px #F5DF50; +} + +button { + margin: -19px; + padding: 10px; + box-shadow:0 0 15px #F5DF50; + border-color:#F5DF50; + background: #1f1d11; + color: #F5DF50; +} + +.feed { + margin: 15px; +} + +.date { + font-weight: bold; + margin: 15px; + color: #4CAF50; +} + +.title { + cursor: pointer; + color: #F5DF50; + background-color: #1f1d11; + margin: 15px; + padding: 5px; +} + +.content { + display: none; + margin: 15px; + padding: 35px; + border: 1px solid #F5DF50; +} +