{"id":16673298,"url":"https://github.com/compolomus/rssreader","last_synced_at":"2026-04-29T07:31:36.115Z","repository":{"id":62550999,"uuid":"505141711","full_name":"Compolomus/RssReader","owner":"Compolomus","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-28T15:59:17.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-19T06:13:27.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Compolomus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-19T15:04:02.000Z","updated_at":"2022-06-19T21:04:38.000Z","dependencies_parsed_at":"2025-01-20T13:50:04.444Z","dependency_job_id":null,"html_url":"https://github.com/Compolomus/RssReader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compolomus%2FRssReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compolomus%2FRssReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compolomus%2FRssReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Compolomus%2FRssReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Compolomus","download_url":"https://codeload.github.com/Compolomus/RssReader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243324266,"owners_count":20273100,"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":[],"created_at":"2024-10-12T12:25:42.607Z","updated_at":"2025-12-28T08:41:05.810Z","avatar_url":"https://github.com/Compolomus.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RssReader by Compolomus\n\n[![License](https://poser.pugx.org/compolomus/RssReader/license)](https://packagist.org/packages/compolomus/RssReader)\n[![Build Status](https://scrutinizer-ci.com/g/Compolomus/RssReader/badges/build.png?b=master)](https://scrutinizer-ci.com/g/Compolomus/RssReader/build-status/master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Compolomus/RssReader/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Compolomus/RssReader/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/Compolomus/RssReader/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Compolomus/RssReader/?branch=master)\n[![Code Climate](https://codeclimate.com/github/Compolomus/RssReader/badges/gpa.svg)](https://codeclimate.com/github/Compolomus/RssReader)\n[![Downloads](https://poser.pugx.org/compolomus/RssReader/downloads)](https://packagist.org/packages/compolomus/RssReader)\n\nSmall library for obtaining RSS feed with caching.\n\n```shell\ncomposer require compolomus/RssReader\n```\n\n## Usage\n\nYou can parse feed from multiple sources at once, and obtained posts will be sorted by timestamp (asc). Here's an example of how to use the `RssReader` class:\n\n**Example**: Parsing RSS feeds and retrieving all posts\n\n```php\n\u003c?php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Compolomus\\RssReader\\RssReader;\n\n// Prepare RSS reader\n$rss = new RssReader([\n    'https://3dnews.ru/breaking/rss/',\n    'https://3dnews.ru/motherboard/rss/',\n]);\n\n// Get all posts\n$result = $rss-\u003egetAll();\nprint_r($result);\n```\n\nAfter the first call of this script, you will see all messages from the RSS\nfeed with their IDs cached. On subsequent calls, only new IDs will be\nprocessed because all cached IDs will be skipped. Each call will append IDs\nto the cache, ensuring that you never receive duplicates from the feed.\n\n**Advanced example**: Same as above but with customizing cache settings\n\n```php\n\u003c?php\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Compolomus\\RssReader\\Cache\\FileCache;\nuse Compolomus\\RssReader\\RssReader;\n\n// Prepare cache\n$cache = new FileCache('/tmp/RssReader', 'ids.txt');\n\n// Prepare RSS reader\n$rss = new RssReader([\n    'https://3dnews.ru/breaking/rss/',\n    'https://3dnews.ru/motherboard/rss/',\n], $cache);\n\n// Get all posts\n$result = $rss-\u003egetAll();\nprint_r($result);\n```\n\n## Environment Variables\n\nThe `RssReader` library supports several environment variables for customization:\n\n| Name                 | Default value                         | Description                                |\n|----------------------|---------------------------------------|--------------------------------------------|\n| RSSREADER_LIMIT      | 0 _(0, empty or not set - unlimited)_ | Limiting the number of recent posts        |\n| RSSREADER_CACHE_DIR  | /tmp/.rssreader_cache                 | Path to directory with cache               |\n| RSSREADER_CACHE_FILE | cacheIds.txt                          | Name of file in which cache will be stored |\n\nEnvironment variable `RSSREADER_LIMIT` allows limiting the number of recent posts.\nBy default, there is no limit (0 or empty). The cache directory and filename\ncan also be customized using the `RSSREADER_CACHE_DIR` and `RSSREADER_CACHE_FILE`\nenvironment variables.\n\n## Testing\n\nTo run tests for this library, execute the following command:\n\n```shell\ncomposer test\n```\n\n## Quality Assurance\n\nThis project uses several tools to ensure code quality and maintainability:\n\n* PHP_CodeSniffer: Checks the code syntax and style against the PSR-12 standard.\n* PHPStan: Performs static analysis of the codebase to find potential bugs and errors.\n* PHPUnit: Used for testing purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompolomus%2Frssreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompolomus%2Frssreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompolomus%2Frssreader/lists"}