{"id":16108159,"url":"https://github.com/aschmelyun/basic-feeds","last_synced_at":"2025-03-18T09:30:24.666Z","repository":{"id":42509040,"uuid":"474537415","full_name":"aschmelyun/basic-feeds","owner":"aschmelyun","description":"📜✏️ A simple PHP library to generate RSS and Atom feeds","archived":false,"fork":false,"pushed_at":"2022-04-02T05:42:18.000Z","size":22,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T08:29:33.352Z","etag":null,"topics":["atom","php","rss","xml"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aschmelyun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-27T04:48:53.000Z","updated_at":"2024-12-17T13:07:58.000Z","dependencies_parsed_at":"2022-09-22T14:41:14.973Z","dependency_job_id":null,"html_url":"https://github.com/aschmelyun/basic-feeds","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Fbasic-feeds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Fbasic-feeds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Fbasic-feeds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aschmelyun%2Fbasic-feeds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aschmelyun","download_url":"https://codeload.github.com/aschmelyun/basic-feeds/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910666,"owners_count":20367546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atom","php","rss","xml"],"created_at":"2024-10-09T19:25:39.579Z","updated_at":"2025-03-18T09:30:24.205Z","avatar_url":"https://github.com/aschmelyun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic Feeds\n\nThis package provides a basic way of generating RSS 2 and Atom XML feeds in PHP using a simplified syntax. There are no external dependencies as this package relies on the built-in [SimpleXMLElement](https://www.php.net/manual/en/class.simplexmlelement.php) class.\n\n## Installation\n\n```bash\ncomposer require aschmelyun/basic-feeds\n```\n\n## Usage\n\nInitialize a feed by using the `Feed::create()` method, passing in an array of attributes needed to set up your feed's base.\n\n```php\nuse Aschmelyun\\BasicFeeds\\Feed;\n\n$feed = Feed::create([\n    'link' =\u003e 'https://example.com/blog',\n    'authors' =\u003e 'Andrew Schmelyun',\n    'title' =\u003e 'My Example Blog',\n    'feed' =\u003e 'https://example.com/feed.xml',\n]);\n```\n\nThen use the `entry()` method on the Feed object to attach entries to your feed.\n\n```php\n$feed-\u003eentry([\n    'title' =\u003e 'Post One',\n    'link' =\u003e 'https://example.com/blog/post-one',\n    'summary' =\u003e 'This is my summary',\n    'content' =\u003e '\u003cp\u003eThis is my example content!\u003c/p\u003e'\n]);\n```\n\nThe `entry()` method can also expect multiple items at once, using a nested array.\n\n```php\n$feed-\u003eentry([\n    'title' =\u003e 'Post Two',\n    'link' =\u003e 'https://example.com/blog/post-two',\n    'summary' =\u003e 'This is my second summary',\n    'content' =\u003e '\u003cp\u003eThis is my second example content!\u003c/p\u003e'\n], [\n    'title' =\u003e 'Post Three',\n    'link' =\u003e 'https://example.com/blog/post-three',\n    'summary' =\u003e 'This is my third summary',\n    'content' =\u003e '\u003cp\u003eThis is my third example content!\u003c/p\u003e'\n]);\n```\n\nYou can then use either the `asAtom()` or `asRss()` method to compile the feed to the requested format and return it as an XML string:\n\n```php\n$xml = $feed-\u003easAtom();\n// $xml = $feed-\u003easRss();\n```\n\n## Requirements\n\nThere are a few required attributes, and they change based on the format(s) you choose.\n\nFor `Feed::create()` they are:\n\n- **RSS**: `title`, `link`, `description`\n- **Atom**: `title`, `link`, `authors`, `feed`\n\nFor `entry()` they are:\n\n- **RSS**: `title`, `link`, `description`\n- **Atom**: `title`, `link`, `summary`, `content`\n\n## Extending\n\nThis package comes with an [interface](https://github.com/aschmelyun/basic-feeds/blob/main/src/Contracts/Generator.php) that you can use to help extend off of this package to create your own feed generator.\n\nCheck out the [Atom](https://github.com/aschmelyun/basic-feeds/blob/main/src/Generators/Atom.php) and [RSS](https://github.com/aschmelyun/basic-feeds/blob/main/src/Generators/Rss.php) classes to see how the included feed generators are structured.\n\n## Testing\n\nIf you don't already have PHPUnit required in your current project, install this package with dev dependencies:\n\n```bash\ncomposer require aschmelyun/basic-feeds --dev\n```\n\nThen run the PHPUnit tests:\n\n```bash\n./vendor/bin/phpunit\n```\n\n## License\n\nThis package is licensed under the The MIT License. See [LICENSE](https://github.com/aschmelyun/basic-feeds/blob/main/LICENSE) for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschmelyun%2Fbasic-feeds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faschmelyun%2Fbasic-feeds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faschmelyun%2Fbasic-feeds/lists"}