{"id":17045874,"url":"https://github.com/totocaster/jsonfeed","last_synced_at":"2025-04-12T15:31:35.827Z","repository":{"id":56916503,"uuid":"91629093","full_name":"totocaster/JSONFeed","owner":"totocaster","description":"Swift parser for JSON Feed — a new format similar to RSS and Atom but in JSON.","archived":false,"fork":false,"pushed_at":"2017-06-04T08:09:04.000Z","size":69,"stargazers_count":32,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T04:52:48.093Z","etag":null,"topics":["feed","json","json-feed","jsonfeed","parsing","swift"],"latest_commit_sha":null,"homepage":"https://jsonfeed.org","language":"Swift","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/totocaster.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}},"created_at":"2017-05-17T23:34:36.000Z","updated_at":"2024-05-31T15:44:07.000Z","dependencies_parsed_at":"2022-08-21T03:50:50.134Z","dependency_job_id":null,"html_url":"https://github.com/totocaster/JSONFeed","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totocaster%2FJSONFeed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totocaster%2FJSONFeed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totocaster%2FJSONFeed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/totocaster%2FJSONFeed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/totocaster","download_url":"https://codeload.github.com/totocaster/JSONFeed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589569,"owners_count":21129636,"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","json","json-feed","jsonfeed","parsing","swift"],"created_at":"2024-10-14T09:42:30.178Z","updated_at":"2025-04-12T15:31:35.462Z","avatar_url":"https://github.com/totocaster.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONFeed\n\n![Swift Version](https://img.shields.io/badge/swift-3.0-orange.svg?style=flat)\n![TravisCI](https://api.travis-ci.org/totocaster/JSONFeed.svg?branch=master)\n[![Platform](https://img.shields.io/cocoapods/p/JSONFeed.svg?style=flat)](http://cocoapods.org/pods/JSONFeed)\n[![Twitter](https://img.shields.io/badge/twitter-@totocaster-blue.svg)](http://twitter.com/totocaster)\n\nSwift parser for JSON Feed — a new format similar to RSS and Atom but in JSON. For more information about this new feed format visit: https://jsonfeed.org\n\n---\n\n⚠️ **Contributions are more than welcome!** Here is how my todo list looks like now:\n\n- [x] Implement framework so its usable\n- [x] Proper in-line documentation\n- [x] Clear documentation in README (you are looking at it now)\n- [x] Add CococaPods support\n- [x] Add Carthage support\n- [ ] Add SPM support\n- [x] Add CHANGELOG to repository\n- [ ] Add much more elaborate tests\n- [x] Add `Equtable` for objects it makes sense\n- [ ] Consider adding byte and date formatter for `JSONFeedAttachment`\n\nThanks for checking-out JSONFeed!\n\n---\n\n## Usage\n\nParsing a feed is super easy; just pass data from a response when creating a feed object and that's it! Parsing happens upon initialization using `JSONSerialization` and if all goes well you'll be able to access `feed` properties. In case initialization parameters are invalid, `JSONFeed` will throw `JSONFeedError`.\n\n```swift\nlet feed = try? JSONFeed(data: responseData)\n```\n\nAlternatively you can create objects from a JSON string or JSON dictionary:\n\n```swift\nlet dictionary: [String: Any] = [\"title\": \"...\"]\nlet feed = try? JSONFeed(json: dictionary)\n```\n\n```swift\nlet utf8String: String = \"{'title':'...\"\nlet feed = try? JSONFeed(jsonString: utf8String)\n```\n---\n\n## Documentation\n\nBest way to learn about this library is to browse source files and inline documentation. \n\nBelow is quick description of objects and their responsibilities:\n\n### Feed and Properties in General \n\nJSONFeed mirrors [JSON Feed v1 spec][v1] defined keys almost one-to-one. Key names are \"Swiftyfied\" and strongly typed: all dates will be `Date` type, URLs — `URL` and so on. All fields defined by optional in [spec][v1] are also Swift optionals in all objects.\n\n### Items\n\n`feed.items` is an array of `JSONFeedItem` objects that wrap your items (posts, episodes for podcasts, etc.). It can not be nil, but can contain 0 elements.\n\n##### `contextText` vs `contentHTML` \n\nAccording to specs both are optional and both can be present in item at the same time. However if none of them is set by publisher, post will be discarded and not included in `items` array.\n \n##### Items with no `id`\n\nIf `id` for the item is not set by publisher, item will be discarded and not included in `items`. This happens silently and no error will be thrown. Any other posts with set `id` will be peresent in array (unless both, `contextText` and `contentHTML` are missing). Reason for that in clearly elaborated in _Suggestions for Feed Readers_ of [JSON Feed v1 spec][v1]:\n\n\u003e [...] there is one thing we insist on: any item without an id must be discarded. We come to this from years of experience dealing with feeds in other formats where unique identifiers are optional. Without unique identifiers, it’s impossible to reliably refer to a given item and its changes over time, and this is terrible for user experience and becomes a source of bug reports to you. \n\n\n### Attachments\n\nItems can have `attachments`, they are wrapped in `JSONFeedAttachment` object. Attachment can be podcast episode, additional images, or any other media.\n\nYou can lear about attachment type using `mimeType` property. All attachments have `url` pointing to attached media. Those two are always present in all attachments.\n\nAdditionally `JSONFeedAttachment` have optional `size` (in bytes) and `duration` (in seconds) for relevant media files.\n\n### Author\n\nInert `JSONFeedAuthor` struct with name, avatar URL and web URL. Can be present both in `JSONFeedItem` and/or in `JSONFeed`.\n\n---\n\n## Installation\n\n#### CocoaPods\nYou can use [CocoaPods](http://cocoapods.org/) to install `JSONFeed` by adding it to your `Podfile`:\n\n```ruby\nplatform :ios, '10.0'\nuse_frameworks!\npod 'JSONFeed'\n```\n\nImport `JSONFeed` wherever you plan to parse feed and follow instructions from above.\n\n\n#### Carthage\nCreate a `Cartfile` that lists the framework and run `carthage update`. Follow the [instructions](https://github.com/Carthage/Carthage#if-youre-building-for-ios) to add `$(SRCROOT)/Carthage/Build/iOS/JSONFeed.framework` to an iOS project.\n\n```\ngithub \"totocaster/JSONFeed\"\n```\n\n#### Manually\nDownload and drop all files from ```Classes``` folder into in your project.\n\n---\n\n## License\n\nJSONFeed is released under the MIT license. See ``LICENSE`` for details.\n\n[v1]: https://jsonfeed.org/version/1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotocaster%2Fjsonfeed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftotocaster%2Fjsonfeed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftotocaster%2Fjsonfeed/lists"}