{"id":20126047,"url":"https://github.com/inteve/feed-generator","last_synced_at":"2025-07-18T19:33:18.514Z","repository":{"id":56992738,"uuid":"82551221","full_name":"inteve/feed-generator","owner":"inteve","description":"Feed Generator for Nette and more.","archived":false,"fork":false,"pushed_at":"2025-02-06T18:38:27.000Z","size":76,"stargazers_count":1,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T15:41:24.061Z","etag":null,"topics":["feed-generator","nette","php"],"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/inteve.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,"zenodo":null}},"created_at":"2017-02-20T11:36:42.000Z","updated_at":"2025-02-06T18:38:30.000Z","dependencies_parsed_at":"2025-05-06T17:41:12.788Z","dependency_job_id":"ebcab3c0-e395-4abe-b54d-5ecac7976c31","html_url":"https://github.com/inteve/feed-generator","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/inteve/feed-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Ffeed-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Ffeed-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Ffeed-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Ffeed-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inteve","download_url":"https://codeload.github.com/inteve/feed-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inteve%2Ffeed-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265820189,"owners_count":23833562,"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":["feed-generator","nette","php"],"created_at":"2024-11-13T20:13:02.660Z","updated_at":"2025-07-18T19:33:18.481Z","avatar_url":"https://github.com/inteve.png","language":"PHP","funding_links":["https://www.patreon.com/bePatron?u=9680759","https://www.paypal.me/janpecha/1eur"],"categories":[],"sub_categories":[],"readme":"\n# Feed Generator\n\n[![Tests Status](https://github.com/inteve/feed-generator/workflows/Tests/badge.svg)](https://github.com/inteve/feed-generator/actions)\n\n\u003ca href=\"https://www.patreon.com/bePatron?u=9680759\"\u003e\u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button.png\" alt=\"Become a Patron!\" height=\"35\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.paypal.me/janpecha/1eur\"\u003e\u003cimg src=\"https://buymecoffee.intm.org/img/button-paypal-white.png\" alt=\"Buy me a coffee\" height=\"35\"\u003e\u003c/a\u003e\n\n\n## Installation\n\n[Download a latest package](https://github.com/inteve/feed-generator/releases) or use [Composer](http://getcomposer.org/):\n\n```\ncomposer require inteve/feed-generator\n```\n\nFeed Generator requires PHP 5.6.0 or later.\n\n\n## Usage\n\n* Feeds\n\t* [Google Merchant](#google-merchant)\n\t* [Glami.cz](#glamicz)\n\t* [Heureka.cz](#heurekacz)\n\t* [Zbozi.cz](#zbozicz)\n\n* Outputs\n\t* [FileOutput](#fileoutput)\n\t* [DirectOutput](#directoutput)\n\t* [MemoryOutput](#memoryoutput)\n\n* Integrations\n\t* [Nette](#nette)\n\n\n### Feeds\n\n#### Google Merchant\n\n``` php\nuse Inteve\\FeedGenerator\\Feeds\\GoogleMerchant;\n\n$feed = new GoogleMerchant\\GoogleMerchantFeed;\n$feed-\u003esetTitle('Products');\n$feed-\u003esetWebsiteUrl('http://www.example.com/');\n$feed-\u003esetUpdated(new DateTime('2017-01-01 00:00:00 UTC'));\n$feed-\u003esetAuthor('Example.com');\n$items = array();\n\nforeach ($products as $product) {\n\t$item = new GoogleMerchant\\GoogleMerchantItem;\n\t$item-\u003esetId($product-\u003eid)\n\t\t-\u003esetTitle($product-\u003etitle)\n\t\t-\u003esetDescription($product-\u003edescription)\n\t\t-\u003esetUrl('https://www.example.com/product/' . $product-\u003eurl)\n\t\t-\u003esetImageUrl('https://www.example.com/images/product/' . $product-\u003eid)\n\t\t-\u003esetAvailability($product-\u003eqty \u003e 0 ? $item::AVAILABILITY_IN_STOCK : $item::AVAILABILITY_OUT_OF_STOCK)\n\t\t-\u003esetPrice($product-\u003eprice, 'USD');\n\t$items[] = $item;\n}\n\n$feed-\u003esetItems($items);\n$feed-\u003egenerate(new Inteve\\FeedGenerator\\Outputs\\FileOutput(__DIR__ . '/feeds/google.xml'));\n```\n\n\n#### Glami.cz\n\n``` php\nuse Inteve\\FeedGenerator\\Feeds\\Glami;\n\n$feed = new Glami\\GlamiFeed;\n$items = array();\n\nforeach ($products as $product) {\n\t$items[] = Glami\\GlamiItem::create()\n\t\t-\u003esetId($product-\u003eid)\n\t\t-\u003esetProductName($product-\u003ename)\n\t\t-\u003esetDescription($product-\u003edescription)\n\t\t-\u003esetCategoryText($product-\u003ecategoryName)\n\t\t-\u003esetUrl('http://www.example.com/product/' . $product-\u003eurl)\n\t\t-\u003esetImageUrl('https://www.example.com/images/product/' . $product-\u003eid)\n\t\t-\u003esetPriceVat($product-\u003eprice)\n\t\t-\u003esetDeliveryDate($product-\u003eqty \u003e 0 ? 0 : 10) // number of days\n\t\t-\u003eaddParameter('velikost', 'XS');\n}\n\n$feed-\u003esetItems($items);\n$feed-\u003egenerate(new Inteve\\FeedGenerator\\Outputs\\FileOutput(__DIR__ . '/feeds/glami.xml'));\n```\n\n\n#### Heureka.cz\n\n``` php\nuse Inteve\\FeedGenerator\\Feeds\\Heureka;\n\n$feed = new Heureka\\HeurekaFeed;\n$items = array();\n\nforeach ($products as $product) {\n\t$items[] = Heureka\\HeurekaItem::create()\n\t\t-\u003esetId($product-\u003eid)\n\t\t-\u003esetProductName($product-\u003ename)\n\t\t-\u003esetDescription($product-\u003edescription)\n\t\t-\u003esetCategoryText($product-\u003ecategoryName)\n\t\t-\u003esetUrl('http://www.example.com/product/' . $product-\u003eurl)\n\t\t-\u003esetImageUrl('https://www.example.com/images/product/' . $product-\u003eid)\n\t\t-\u003esetPrice($product-\u003eprice)\n\t\t-\u003esetDeliveryDate($product-\u003eqty \u003e 0 ? 0 : 10); // number of days or DateTime\n}\n\n$feed-\u003esetItems($items);\n$feed-\u003egenerate(new Inteve\\FeedGenerator\\Outputs\\FileOutput(__DIR__ . '/feeds/heureka.xml'));\n```\n\n\n#### Zbozi.cz\n\n``` php\nuse Inteve\\FeedGenerator\\Feeds\\Zbozi;\n\n$feed = new Zbozi\\ZboziFeed;\n$items = array();\n\nforeach ($products as $product) {\n\t$items[] = Zbozi\\ZboziItem::create()\n\t\t-\u003esetId($product-\u003eid)\n\t\t-\u003esetProductName($product-\u003ename)\n\t\t-\u003esetDescription($product-\u003edescription)\n\t\t-\u003esetUrl('http://www.example.com/product/' . $product-\u003eurl)\n\t\t-\u003esetImageUrl('https://www.example.com/images/product/' . $product-\u003eid)\n\t\t-\u003esetPrice($product-\u003eprice)\n\t\t-\u003esetDeliveryDate($product-\u003eqty \u003e 0 ? 0 : 10); // number of days or DateTime\n}\n\n$feed-\u003esetItems($items);\n$feed-\u003egenerate(new Inteve\\FeedGenerator\\Outputs\\FileOutput(__DIR__ . '/feeds/zbozi.xml'));\n```\n\n\n### Outputs\n\n#### FileOutput\n\nSends output to file.\n\n``` php\n$output = new Inteve\\FeedGenerator\\Outputs\\FileOutput('/path/to/destination/feed.xml');\n$feed-\u003egenerate($output);\n```\n\n\n#### DirectOutput\n\nSends output to STDIN.\n\n``` php\n$output = new Inteve\\FeedGenerator\\Outputs\\DirectOutput;\n$feed-\u003egenerate($output);\n```\n\n\n#### MemoryOutput\n\nSaves output in memory.\n\n``` php\n$output = new Inteve\\FeedGenerator\\Outputs\\MemoryOutput;\n$feed-\u003egenerate($output);\necho $output-\u003egetOutput();\n```\n\n\n### Integrations\n\n#### [Nette](https://nette.org/)\n\nRequires package [`nette/application`](https://packagist.org/packages/nette/application).\n\n``` php\n$response = new FeedGenerator\\Responses\\NetteDownloadResponse($feed, 'filename');\n$presenter-\u003esendResponse($response);\n```\n\nFor example:\n\n``` php\nclass FeedPresenter extends Nette\\Application\\UI\\Presenter\n{\n\tpublic function actionGoogle()\n\t{\n\t\t$feed = new FeedGenerator\\Feeds\\GoogleMerchant\\GoogleMerchantFeed;\n\t\t// prepare feed \u0026 items\n\n\t\t$response = new FeedGenerator\\Responses\\NetteDownloadResponse($feed, 'google.xml');\n\t\t$this-\u003esendResponse($response);\n\t}\n}\n```\n\n------------------------------\n\nLicense: [New BSD License](license.md)\n\u003cbr\u003eAuthor: Jan Pecha, https://www.janpecha.cz/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteve%2Ffeed-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteve%2Ffeed-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteve%2Ffeed-generator/lists"}