A very simple light-weight RSS parser
rss
Find a file
2023-08-13 19:27:33 -04:00
.idea Initial Commit 2023-08-13 18:09:44 -04:00
src/RssLib Fixed issue in \RssLib\Objects\RssFeed > Guid where guid isn't correctly parsed if the "isPermaLink" attribute is missing. 2023-08-13 19:27:33 -04:00
tests Initial Commit 2023-08-13 18:09:44 -04:00
.gitignore Initial Commit 2023-08-13 18:09:44 -04:00
.gitlab-ci.yml Initial Commit 2023-08-13 18:09:44 -04:00
CHANGELOG.md Fixed issue in \RssLib\Objects\RssFeed > Guid where guid isn't correctly parsed if the "isPermaLink" attribute is missing. 2023-08-13 19:27:33 -04:00
LICENSE Initial Commit 2023-08-13 18:09:44 -04:00
Makefile Initial Commit 2023-08-13 18:09:44 -04:00
project.json Fixed issue in \RssLib\Objects\RssFeed > Guid where guid isn't correctly parsed if the "isPermaLink" attribute is missing. 2023-08-13 19:27:33 -04:00
README.md Initial Commit 2023-08-13 18:09:44 -04:00

RssLib

RssLib is a library used to parse RSS feeds and return the data in a usable format.

Table of contents

Installation

The library can be installed using ncc:

ncc install -p "nosial/libs.rss=latest@n64"

or by adding the following to your project.json file under the build.dependencies section:

{
  "name": "net.nosial.rsslib",
  "version": "latest",
  "source_type": "remote",
  "source": "nosial/libs.rsslib=latest@n64"
}

If you don't have the n64 source configured, you can add it by running the following command:

ncc source add --name n64 --type gitlab --host git.n64.cc

Compile from source

To compile the library from source, you need to have ncc installed, then run the following command:

ncc build

Requirements

The library requires PHP 8.0 or higher.

Documentation

The library is designed to be used as a dependency in other projects, and as such, does not have a command-line interface. The library is designed to be used as follows:

try
{
    $feed = \RssLib\RssLib::getFeed('https://rss.nytimes.com/services/xml/rss/nyt/World.xml');
}
catch(\RssLib\Exceptions\RssFeedException $e)
{
    echo $e->getMessage();
    exit(1);
}

print("Title: {$feed->getTitle()}\n");
print("Description: {$feed->getDescription()}\n");
foreach($feed->getItems() as $item)
{
    print("Item: {$item->getTitle()}\n");
    print("Description: {$item->getDescription()}\n");
    print("Link: {$item->getLink()}\n");
}

License

Distributed under the MIT License. See LICENSE for more information.