{"id":23765821,"url":"https://github.com/solidusio-contrib/solidus_feeds","last_synced_at":"2025-09-05T09:33:07.960Z","repository":{"id":43831628,"uuid":"282179165","full_name":"solidusio-contrib/solidus_feeds","owner":"solidusio-contrib","description":"A framework for producing and publishing feeds on Solidus","archived":false,"fork":false,"pushed_at":"2025-01-04T12:17:24.000Z","size":76,"stargazers_count":9,"open_issues_count":3,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-01T01:26:45.167Z","etag":null,"topics":["ecommerce","feeds","product-feed","rails","s3-storage","solidus","solidus-extensions"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solidusio-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-07-24T09:33:45.000Z","updated_at":"2025-08-11T01:19:10.000Z","dependencies_parsed_at":"2024-06-25T09:22:16.453Z","dependency_job_id":"b67922f3-a776-4e13-8ae9-44464f42b3ac","html_url":"https://github.com/solidusio-contrib/solidus_feeds","commit_stats":{"total_commits":26,"total_committers":5,"mean_commits":5.2,"dds":"0.46153846153846156","last_synced_commit":"d4c419343cd1d286631775acac3edba03b79a291"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/solidusio-contrib/solidus_feeds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_feeds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_feeds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_feeds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_feeds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidusio-contrib","download_url":"https://codeload.github.com/solidusio-contrib/solidus_feeds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidusio-contrib%2Fsolidus_feeds/sbom","scorecard":{"id":837077,"data":{"date":"2025-08-11","repo":{"name":"github.com/solidusio-contrib/solidus_feeds","commit":"006a0be5b9c2912d0af992c625a3ca40b4331b3e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Code-Review","score":5,"reason":"Found 8/14 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T19:22:01.343Z","repository_id":43831628,"created_at":"2025-08-23T19:22:01.343Z","updated_at":"2025-08-23T19:22:01.343Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273739168,"owners_count":25159288,"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-09-05T02:00:09.113Z","response_time":402,"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":["ecommerce","feeds","product-feed","rails","s3-storage","solidus","solidus-extensions"],"created_at":"2024-12-31T23:18:06.693Z","updated_at":"2025-09-05T09:33:07.926Z","avatar_url":"https://github.com/solidusio-contrib.png","language":"Ruby","readme":"# Solidus Feeds\n\n[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_feeds.svg?style=shield)](https://circleci.com/gh/solidusio-contrib/solidus_feeds)\n[![codecov](https://codecov.io/gh/solidusio-contrib/solidus_feeds/branch/main/graph/badge.svg)](https://codecov.io/gh/solidusio-contrib/solidus_feeds)\n\n\u003c!-- Explain what your extension does. --\u003e\nA framework for producing and publishing feeds on Solidus.\n\n## Installation\n\nAdd solidus_feeds to your Gemfile:\n\n```ruby\ngem 'solidus_feeds'\n```\n\nBundle your dependencies and run the installation generator:\n\n```shell\nbin/rails generate solidus_feeds:install\n```\n\n## Out of the box usage\n\n\u003c!-- Explain how to use your extension once it's been installed. --\u003e\n\nLet's say that you want to generate a XML feed for products belonging to the `Shoes` taxon,\nconsumable by Google Merchant compatible marketplaces  and make it publicly available on your\n`my-bucket` S3 bucket at the path `foo/bar.xml`.\n\nTo register the feed you'd need to add the following code to an initializer such as\n`config/initializers/solidus.rb` or better yet `config/initializers/solidus_feeds.rb`\n\n```ruby\nRails.application.config.to_prepare do\n  SolidusFeeds.config.register :google_merchant_shoes do |feed|\n    taxon = Spree::Taxon.find_by(name: \"Shoes\")\n    products = Spree::Product.available.in_taxon(taxon)\n\n    feed.generator = SolidusFeeds::Generators::GoogleMerchant.new(products, host: Spree::Store.default.url)\n    feed.publisher = SolidusFeeds::Publishers::S3.new(bucket: \"my-bucket\", object_key: \"foo/bar.xml\")\n  end\nend\n```\n\nThen make your Solidus app generate and publish the feed by calling the following line. It's\nrecommended to call it in a background job, especially when generating feeds with large amounts of\nproducts.\n\n```ruby\nSolidusFeeds.configuration.find(:google_merchant_shoes).publish\n```\n\nHaving it in a background job makes it easier to:\n\n- Launch it manually from the backend dashboard\n- Make it refresh periodically via cron, sidekiq-scheduler, Heroku scheduler or similar\n- Refresh the feed when receiving data from a [webhook](https://github.com/solidusio-contrib/solidus_webhooks)\n  or after specific Solidus events\n\n## Serving the feed from the products controller (legacy)\n\nWe suggest to avoid this behaviour because it could be resource intensive, especially with a large\nnumber of products.\n\nIf you want to support the legacy behaviour of [`solidus_product_feed`](https://github.com/solidusio-contrib/solidus_product_feed)\nand publish a XML feed at `/products.rss`, you can add the following decorator:\n\n```ruby\n# app/decorators/controllers/solidus_feeds/spree/products_controller.rb\n\nmodule SolidusFeeds\n  module Spree\n    module ProductsControllerDecorator\n      def self.prepended(klass)\n        klass.respond_to :rss, only: :index\n        klass.before_action :verify_requested_format!, only: :index\n      end\n\n      def index\n        render as: :xml, body: load_feed_products if request.format.rss?\n        super\n      end\n\n      private\n\n      def load_feed_products\n        @products = ::Spree::Product.all\n        io = StringIO.new\n        SolidusFeeds::Generators::GoogleMerchant\n          .new(@products, host: 'https://example.com')\n          .call(io)\n        io.rewind\n        io.read\n      end\n\n      ::Spree::ProductsController.prepend self\n    end\n  end\nend\n```\n\n## Publishing backends\n\n### S3\n\nIf you don't want to configure a S3 `client` each time, you can load your AWS config in an\ninitializer:\n\n```ruby\n# config/initializers/aws.rb\n\nAws.config[:profile] = 'my-profile'\n```\n\nThen config your S3 publisher specifying the `bucket`, `object_key` and an optional `client` if you\nneed custom configuration on a per-publisher basis.\n\n```ruby\n# config/initializers/solidus_feeds.rb\n\nRails.application.config.to_prepare do\n  SolidusFeeds.config.register :all_products do |feed|\n    feed.generator = SolidusFeeds::Generators::GoogleMerchant.new(\n      Spree::Product.all,\n      host: Spree::Store.default.url\n    )\n    feed.publisher = SolidusFeeds::Publishers::S3.new(\n      bucket: \"foo\",\n      object_key: \"bar/my_feed.xml\",\n      client: Aws::S3::Client.new(…), # This is optional - use only if a custom config is needed\n    )\n  end\nend\n# visit https://s3.us-east-1.amazonaws.com/foo/bar/my_feed.xml\n```\n\n### Static file\n\nTo publish the feed directly from an app directory (e.g. the `public` directory), you can use the\nStatic File Publisher as such:\n\n```ruby\n# config/initializers/solidus_feeds.rb\n\nRails.application.config.to_prepare do\n  SolidusFeeds.config.register :all_products do |feed|\n    feed.generator = SolidusFeeds::Generators::GoogleMerchant.new(\n      Spree::Product.all,\n      host: Spree::Store.default.url\n    )\n    feed.publisher = SolidusFeeds::Publishers::StaticFile.new(\n      path: Rails.root.join('public/products.xml')\n    )\n  end\nend\n```\n\n## Builtin Marketplace format generators\n\n- Google Merchant XML: compatible with Google Merchant and Facebook/Instagram feeds\n\n## Creating your own Generators and Publishers\n\nBoth the generator and the publisher are expected to respond to `#call`.\n\nThe publisher's `#call` method is expected to yield an IO-like object that responds to `#\u003c\u003c`.\n\n### Example\n\nFor example a simple feed that will publish recently added products to Rails' public folder in JSON\nformat would look like this:\n\n```ruby\nclass FilePublisher \u003c Struct.new(:path)\n  def call\n    File.open(path, 'w') do |file|\n      yield file\n    end\n  end\nend\n\nclass JsonProductFeed \u003c Struct.new(:products)\n  def call(io)\n    products.find_each do |product|\n      io \u003c\u003c product.to_json\n    end\n  end\nend\n\nSolidusFeeds.register :recent_products do |feed|\n  recent_products = Spree::Product.where(created_at: Time.now..2.weeks.ago)\n\n  feed.generator = JsonProductFeed.new(recent_products)\n  feed.publisher = FilePublisher.new(Rails.root.join(\"public/product.json\")\nend\n```\n\n## Development\n\n### Testing the extension\n\nFirst bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy\napp if it does not exist, then it will run specs. The dummy app can be regenerated by using\n`bin/rake extension:test_app`.\n\n```shell\nbin/rake\n```\n\nTo run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run\n\n```shell\nbundle exec rubocop\n```\n\nWhen testing your application's integration with this extension you may use its factories.\nSimply add this require statement to your spec_helper:\n\n```ruby\nrequire 'solidus_feeds/factories'\n```\n\n### Running the sandbox\n\nTo run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for\nthe sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands to\n`sandbox/bin/rails`.\n\nHere's an example:\n\n```\n$ bin/rails server\n=\u003e Booting Puma\n=\u003e Rails 6.0.2.1 application starting in development\n* Listening on tcp://127.0.0.1:3000\nUse Ctrl-C to stop\n```\n\n### Updating the changelog\n\nBefore and after releases the changelog should be updated to reflect the up-to-date status of\nthe project:\n\n```shell\nbin/rake changelog\ngit add CHANGELOG.md\ngit commit -m \"Update the changelog\"\n```\n\n### Releasing new versions\n\nPlease refer to the dedicated [page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) on Solidus wiki.\n\n## License\n\nCopyright (c) 2021 Nebulab SRLs, released under the New BSD License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidusio-contrib%2Fsolidus_feeds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidusio-contrib%2Fsolidus_feeds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidusio-contrib%2Fsolidus_feeds/lists"}