{"id":36238595,"url":"https://github.com/pqrs/checkrss","last_synced_at":"2026-01-13T21:37:41.204Z","repository":{"id":57044138,"uuid":"120895050","full_name":"pqrs/checkrss","owner":"pqrs","description":"Check RSS feeds for new items","archived":false,"fork":false,"pushed_at":"2018-02-14T11:04:24.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-11T11:44:39.554Z","etag":null,"topics":["php","rss","rss-feed"],"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/pqrs.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":"2018-02-09T10:57:49.000Z","updated_at":"2018-02-11T20:46:47.000Z","dependencies_parsed_at":"2022-08-24T04:50:39.770Z","dependency_job_id":null,"html_url":"https://github.com/pqrs/checkrss","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pqrs/checkrss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pqrs%2Fcheckrss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pqrs%2Fcheckrss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pqrs%2Fcheckrss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pqrs%2Fcheckrss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pqrs","download_url":"https://codeload.github.com/pqrs/checkrss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pqrs%2Fcheckrss/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28401055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["php","rss","rss-feed"],"created_at":"2026-01-11T06:07:12.251Z","updated_at":"2026-01-13T21:37:41.199Z","avatar_url":"https://github.com/pqrs.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CheckRSS\n\nCheck RSS feeds for new items\n\nCheckRSS provides some methods to:\n\n* Get all the items in a RSS feed\n* Check which of those items is/are new since last check\n* Write a log every time a checking for new items is run\n\nIt is recommended using CheckRSS with a cron job so you can get new items periodically, although you can run it manually too.\n\n\n## Installation\n\n```\ncomposer require pqrs/checkrss=dev-master\n```\n\nAlternatively, add the dependency directly to your composer.json file:\n\n```\n\"require\": {\n    \"pqrs/checkrss\": \"dev-master\"\n}\n```\n\nThen add to your php code:\n\n``` php\nrequire_once __DIR__ . '/vendor/autoload.php';   // Autoload files using Composer autoload\n\nuse CheckRSS\\RSS;\n```\n\n## Usage\n\n### method getItems($feed_url)\n\nThis method gets **all the items** published in the rss feed and returns an object containing them.\n\n``` php\n$rss = new RSS;\n\n$items = $rss-\u003egetItems(\"http://feeds.nbcnews.com/feeds/topstories\");\n```\n\nAn example of the object returned would be:\n\n```\nSimpleXMLElement Object\n(\n    [guid] =\u003e https://www.nbcnews.com/storyline/hurricane-irma/...\n    [title] =\u003e One-two punch of disease and Irma has left Florida citrus reeling\n    [pubDate] =\u003e Sat, 10 Feb 2018 15:17:00 GMT\n    [link] =\u003e https://www.nbcnews.com/storyline/hurricane-irma/...\n    [description] =\u003e Hurricane Irma served as a knockout punch for many of Florida's...\n)\n```\n\n### method getNewItems($items)\n\nThis method checks which items in a feed (obtained with getItems) are new since the last a check was made.\n\nReturns an object with just the **new items**.\n\n``` php\n$rss = new RSS;\n\n// Gets all the items published in the rss feed and stores them in $items\n$items = $rss-\u003egetItems(\"http://feeds.nbcnews.com/feeds/topstories\");\n\n// Checks which items are new since last check\nif ($newitems = $rss-\u003egetNewItems($items) ) {\n\n    // Prints new items\n    echo \"New items found:\" . PHP_EOL . PHP_EOL;\n\n    foreach ($newitems as $value) {\n\n        echo $value-\u003etitle          . PHP_EOL;\n        echo $value-\u003edescription    . PHP_EOL;\n        echo $value-\u003eguid           . PHP_EOL;\n        echo $value-\u003elink           . PHP_EOL. PHP_EOL;\n\n    }\n\n} else {\n\n    echo \"There'are no new items in RSS feed\";\n\n}\n```\n\n### method storeLastItemID($item_id)\n\n**Internal use**. This method writes the last read item id in a file to compare it in future checks.\n\n\n### method isNewItem($item_id)\n\n**Internal use**. This method compares the last read item id with the last stored one in previous check.\n\n\n### method WriteLog($logline)\n\nA simple method to write a log file everytime a check is made.\n\n\n## Examples\n\nYou can find some uses for these functions in [tests folder](tests).\n\n\n## Prerequisites\n\nPHP 5.3.0\n\n\n## Contributing\n\nContributions are of course very welcome!\n\n\n## Credits\n\n**Copyright © 2018 Alvaro Piqueras** - [pqrs](https://github.com/pqrs)\n\nThis is a cleanup of a dirty code I wrote some time ago. Also it's my first try with GitHub, Composer and Packagist so if you find some mistakes or have some tips for me, I would be more than glad to hear you.\n\nI hope this code suites your needs.\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpqrs%2Fcheckrss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpqrs%2Fcheckrss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpqrs%2Fcheckrss/lists"}