{"id":26232785,"url":"https://github.com/kalimeromk/rssfeed","last_synced_at":"2025-08-30T06:41:27.582Z","repository":{"id":174431028,"uuid":"652227668","full_name":"KalimeroMK/RssFeed","owner":"KalimeroMK","description":"This package provides an easy way to parse RSS feeds and save them into your application. It provides features like fetching the entire content of an RSS feed, saving images found in the feed items, and getting full content of each item in the feed.","archived":false,"fork":false,"pushed_at":"2025-03-26T17:41:44.000Z","size":133,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-22T20:57:00.858Z","etag":null,"topics":["agregation","laravel","rss-aggregator","rss-feed"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KalimeroMK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2023-06-11T13:51:16.000Z","updated_at":"2025-03-26T17:41:48.000Z","dependencies_parsed_at":"2024-04-26T22:36:37.755Z","dependency_job_id":"6fc0a70f-46bd-4c5e-a38c-d4c1899c6fd5","html_url":"https://github.com/KalimeroMK/RssFeed","commit_stats":null,"previous_names":["kalimeromk/rssfeed"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/KalimeroMK/RssFeed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KalimeroMK%2FRssFeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KalimeroMK%2FRssFeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KalimeroMK%2FRssFeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KalimeroMK%2FRssFeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KalimeroMK","download_url":"https://codeload.github.com/KalimeroMK/RssFeed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KalimeroMK%2FRssFeed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272815816,"owners_count":24997661,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["agregation","laravel","rss-aggregator","rss-feed"],"created_at":"2025-03-13T00:38:32.725Z","updated_at":"2025-08-30T06:41:27.514Z","avatar_url":"https://github.com/KalimeroMK.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RssFeed Laravel Package\n\nThis package provides an easy way to parse RSS feeds and save them into your application. It offers features like fetching the entire content of an RSS feed, saving images found in the feed items, and getting the full content of each item in the feed.\n\n## Features\n\n1. Parses multiple RSS feeds.\n2. Saves images in the RSS feed items to a storage location.\n3. Retrieves the full content of each item in the RSS feed.\n4. Supports **Spatie Media Library** for storing images.\n\n## Requirements\n\n* PHP 7.4 or higher\n* Laravel 5.5 or higher\n* SimplePie PHP library 1.8 or higher\n* Optional: Spatie Media Library (if enabled for image storage)\n\n## Installation\n\nYou can install this package via Composer using:\n\n```bash\ncomposer require kalimeromk/rssfeed\n```\n\nThis package uses Laravel's auto-discovery feature, so you don't need to register the service provider.\n\n## Configuration\n\nThis package supports optional configuration.\n\nYou can publish the configuration file using:\n\n```bash\nphp artisan vendor:publish --provider=\"Kalimeromk\\Rssfeed\\RssFeedServiceProvider\" --tag=\"config\"\n```\n\nThis will publish a `rssfeed.php` config file to your `config` directory. Here you can set various options for image storage and media handling.\n\n```php\nreturn [\n    'image_storage_path' =\u003e 'images',\n    'spatie_media_type' =\u003e 'image',\n    'spatie_disk' =\u003e 'public',\n    'spatie_enabled' =\u003e false,\n    'content_selectors' =\u003e [\n    ],\n    'default_selector' =\u003e '//div[contains(@class, \"item-page\")]\n                           | //div[contains(@class, \"post-content\") and contains(@class, \"entry-content\")]',// Set to true if using Spatie Media Library\n];\n```\n\n### Configuration Options:\n* `image_storage_path`: Specifies the path where images from RSS feed items should be stored (if not using Spatie Media Library).\n* `spatie_media_type`: Defines the media collection type when using Spatie Media Library.\n* `spatie_disk`: Specifies which Laravel storage disk to use.\n* `spatie_enabled`: Set to `true` if you want to store images using Spatie Media Library.\n* `default_selector`: The default selector to use when extracting the full content of an RSS feed item.\n* `content_selectors`: Here you can map specific domains to custom XPath selectors for fetching full content from a post. If the post URL belongs to one of these domains, its selector will be used.\n\n## Usage\n\nBelow is an example of how to use this package.\n\n```php\nnamespace App\\Http\\Controllers;\n\nuse Kalimeromk\\Rssfeed\\RssFeed;\nuse Illuminate\\Http\\Request;\n\nclass RssFeedController extends Controller\n{\n    public function index()\n    {\n        $feed = RssFeed::parseRssFeeds('https://example.com/feed/');\n        \n        $result = [\n            'title' =\u003e $feed-\u003eget_title(),\n            'description' =\u003e $feed-\u003eget_description(),\n            'permalink' =\u003e $feed-\u003eget_permalink(),\n            'link' =\u003e $feed-\u003eget_link(),\n            'copyright' =\u003e $feed-\u003eget_copyright(),\n            'language' =\u003e $feed-\u003eget_language(),\n            'image_url' =\u003e $feed-\u003eget_image_url(),\n            'author' =\u003e $feed-\u003eget_author()\n        ];\n        foreach ($feed-\u003eget_items(0, $feed-\u003eget_item_quantity()) as $item) {\n            $i['title'] = $item-\u003eget_title();\n            $i['description'] = $item-\u003eget_description();\n            $i['id'] = $item-\u003eget_id();\n            $i['content'] = $item-\u003eget_content();\n            $i['thumbnail'] = $item-\u003eget_thumbnail() ?: $rssFeed-\u003eextractImageFromDescription($item-\u003eget_content());\n            $i['category'] = $item-\u003eget_category();\n            $i['categories'] = $item-\u003eget_categories();\n            $i['author'] = $item-\u003eget_author();\n            $i['authors'] = $item-\u003eget_authors();\n            $i['date'] = $item-\u003eget_date();\n            $i['permalink'] = $item-\u003eget_permalink();\n            $i['link'] = $item-\u003eget_link();\n            $result['items'][] = $i;\n        }\n        \n        return $result;\n    }\n}\n```\n\n## Saving Images\n\nYou can save images found in the RSS feed items using the `saveImagesToStorage` method. This method accepts an array of image URLs and returns an array of saved image names or URLs.\n\n### **Using Default Laravel Storage**\n```php  \n$images = [\n    'http://example.com/image1.jpg',\n    'http://example.com/image2.jpg',\n];\n$savedImageNames = $rssFeed-\u003esaveImagesToStorage($images);\n```\n\n### **Using Spatie Media Library**\n\nIf you have **Spatie Media Library** enabled and you want to save images to a media collection:\n\n```php\nuse App\\Models\\Post;\nuse Kalimeromk\\Rssfeed\\RssFeed;\n\n$rssFeed = new RssFeed(app());\n$post = Post::find(1); // Model must implement HasMedia\n\n$images = [\n    'http://example.com/image1.jpg',\n    'http://example.com/image2.jpg',\n];\n$savedMediaUrls = $rssFeed-\u003esaveImagesToStorage($images, $post);\n```\n\n### **Ensure Your Model Implements Spatie Media Library**\n```php\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Spatie\\MediaLibrary\\HasMedia;\nuse Spatie\\MediaLibrary\\InteractsWithMedia;\n\nclass Post extends Model implements HasMedia\n{\n    use InteractsWithMedia;\n}\n```\n\n## Jobs\n\nIf you need to dispatch the RssFeed job, you can do so as follows:\n\n```php\nuse Kalimeromk\\Rssfeed\\Jobs\\RssFeedJob;\n\n$feedUrls = ['https://example.com/rss'];\n\nRssFeedJob::dispatch($feedUrls);\n```\n\n## Credits\n\nThis package was created by KalimeroMK.\n\n## License\n\nThe MIT License (MIT). Please see License File for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkalimeromk%2Frssfeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkalimeromk%2Frssfeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkalimeromk%2Frssfeed/lists"}