{"id":13507912,"url":"https://github.com/michaelnisi/feeder","last_synced_at":"2025-05-08T23:43:14.655Z","repository":{"id":62429549,"uuid":"14310082","full_name":"michaelnisi/feeder","owner":"michaelnisi","description":"Parse RSS and Atom feeds","archived":false,"fork":false,"pushed_at":"2024-05-27T16:49:37.000Z","size":265,"stargazers_count":44,"open_issues_count":2,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T23:43:09.817Z","etag":null,"topics":["atom-feed-parser","erlang","rss-feed-parser"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/michaelnisi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["michaelnisi"]}},"created_at":"2013-11-11T19:02:06.000Z","updated_at":"2025-02-20T23:47:49.000Z","dependencies_parsed_at":"2024-06-21T03:55:45.578Z","dependency_job_id":"4bc26d16-d98b-4adc-9eca-46daaab009b3","html_url":"https://github.com/michaelnisi/feeder","commit_stats":{"total_commits":146,"total_committers":6,"mean_commits":"24.333333333333332","dds":0.06164383561643838,"last_synced_commit":"de2004cb954a5a70390a680e2cb0ed697dfcfd27"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnisi%2Ffeeder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnisi%2Ffeeder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnisi%2Ffeeder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelnisi%2Ffeeder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelnisi","download_url":"https://codeload.github.com/michaelnisi/feeder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166474,"owners_count":21864467,"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":["atom-feed-parser","erlang","rss-feed-parser"],"created_at":"2024-08-01T02:00:42.740Z","updated_at":"2025-05-08T23:43:14.637Z","avatar_url":"https://github.com/michaelnisi.png","language":"Erlang","funding_links":["https://github.com/sponsors/michaelnisi"],"categories":["Feeds"],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/michaelnisi/feeder.svg)](http://travis-ci.org/michaelnisi/feeder)\n\n# feeder - parse RSS and Atom\n\nThe **feeder** [Erlang](http://www.erlang.org/) library parses RSS and Atom formatted XML feeds. It is a stream based parser that sends its events through a callback interface.\n\n## Usage\n\nParse a file and accumulate parser events:\n\n```erlang\n-module(acc).\n-export([file/1]).\n\nevent({entry, Entry}, {Feed, Entries}) -\u003e\n  {Feed, [Entry|Entries]};\nevent({feed, Feed}, {[], Entries}) -\u003e\n  {Feed, Entries};\nevent(endFeed, {Feed, Entries}) -\u003e\n  {Feed, lists:reverse(Entries)}.\n\nopts() -\u003e\n  [{event_state, {[],[]}}, {event_fun, fun event/2}].\n\nfile(Filename) -\u003e\n  {ok, EventState, _Rest} = feeder:file(Filename, opts()),\n  EventState.\n```\n\n## Example\n\nTo try HTTP streaming do:\n\n```\ncd example\nmake\nerl -pa ebin deps/*/ebin\n```\n\n```erlang\nfedex:start().\nfedex:fetch(\"http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml\").\n```\n\n## Types\n\n### feed()\n\nThe `channel` or `feed` tuple.\n\n### enclosure()\n\nThe `enclosure` tuple for an `item` or `entry`.\n\n### entry()\n\nAn `item` or `entry` tuple.\n\n### option()\n\nOptions to setup the parser.\n\n`{continuation_fun, ContinuationFun}`\n[`ContinuationFun`](http://www.erlang.org/doc/man/xmerl_sax_parser.html#ContinuationFun-1) is a call back function to decide what to do if the parser runs into EOF before the document is complete.\n\n`{continuation_state, term()}`\nState that is accessible in the continuation call back function.\n\n`{event_fun, EventFun}`\n[`EventFun`](http://www.erlang.org/doc/man/xmerl_sax_parser.html#EventFun-3) is the call back function for parser events.\n\n`{event_state, term()}`\nState that is accessible in the event call back function.\n\n### event()\n\nThe events that are sent to the user via the callback.\n\n```erlang\n{feed, Feed}\n```\n\n- `Feed = feed()`\n\nReceive notification when the meta information of the feed or channel has been parsed.\n\n```erlang\n{entry, Entry}\n```\n\n- `Entry = entry()`\n\nReceive notification for each entry or article in the feed.\n\n```erlang\nendFeed\n```\n\nReceive notification of the end of a document. **feeder** will send this event only once, and it will be the last event during the parse.\n\n## Exports\n\n### Parsing feeds\n\n```erlang\nfeeder:file(Filename, Opts) -\u003e Result\n```\n- `Filename = string()`\n- `Opts = [option()]`\n- `Result = {ok, EventState, Rest}`\n- `Rest = unicode_binary() | latin1_binary()`\n- `EventState = term()`\n\n```erlang\nfeeder:stream(Xml, Opts) -\u003e Result\n```\n- `Xml = unicode_binary() | latin1_binary() | [unicode_char()]`\n- `Opts = [option()]`\n- `Result = {ok, EventState, Rest}`\n- `Rest = unicode_binary() | latin1_binary()`\n- `EventState = term()`\n\n### Accessing values\n\n```erlang\nfeeder_feeds:get(Key, Feed) -\u003e Value\n```\n- `Key = author | id | image | language | link | subtitle | summary | title | updated | url`\n- `Feed = feed()`\n- `Value = binary() | undefined`\n\n```erlang\nfeeder_enclosures:get(Key, Enclosure) -\u003e Value\n```\n- `Key = url | length | type`\n- `Enclosure = enclosure()`\n- `Value = binary() | undefined`\n\n```erlang\nfeeder_entries:get(Key, Entry) -\u003e Value\n```\n- `Key = author | categories | duration | enclosure | id | image | link | subtitle | summary | title | updated`\n- `Entry = entry()`\n- `Value = binary() | enclosure() | undefined`\n\n## Tests\n\n```bash\n$ make tests\n```\n\n## Install\n\nYou can install **feeder** with [Rebar3](https://github.com/erlang/rebar3), of course, and there are [hex](https://hex.pm/packages/feeder) and [erlang.mk](https://github.com/ninenines/erlang.mk/tree/master/index) packages.\n\n## License\n\n[MIT License](https://raw.github.com/michaelnisi/feeder/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelnisi%2Ffeeder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelnisi%2Ffeeder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelnisi%2Ffeeder/lists"}