index.md (3551B)
1 --- 2 title: "JSON Feed Is Cool (+ a Simple Tool to Create Your Own)" 3 date: 2017-08-02T00:00:00+00:00 4 draft: false 5 canonical_url: https://www.viget.com/articles/json-feed-validator/ 6 --- 7 8 A few months ago, Manton Reece and Brent Simmons [announced the creation 9 of JSON Feed](https://jsonfeed.org/2017/05/17/announcing_json_feed), a 10 new JSON-based syndication format similar to (but so much better than) 11 [RSS](https://en.wikipedia.org/wiki/RSS) and 12 [Atom](https://en.wikipedia.org/wiki/Atom_(standard)). One might 13 reasonably contend that Google killed feed-based content aggregation in 14 2013 when they end-of-lifed™ Google Reader, but RSS continues to enjoy 15 [underground 16 popularity](http://www.makeuseof.com/tag/rss-dead-look-numbers/) and 17 JSON Feed has the potential to make feed creation and consumption even 18 more widespread. So why are we[^1] so excited about it? 19 20 ## JSON > XML 21 22 RSS and Atom are both XML-based formats, and as someone who's written 23 code to both produce and ingest these feeds, it's not how I'd choose to 24 spend a Saturday. Or even a Tuesday. Elements in XML have both 25 attributes and children, which is a mismatch for most modern languages' 26 native data structures. You end up having to use libraries like 27 [Nokogiri](http://www.nokogiri.org/) to write code like 28 `item.attributes["name"]` and `item.children[0]`. And producing a feed 29 usually involves a full-blown templating solution like ERB. Contrast 30 that with JSON, which maps perfectly to JavaScript objects (-\_-), Ruby 31 hashes/arrays, Elixir maps, etc., etc. Producing a feed becomes a call 32 to `.to_json`, and consuming one, `JSON.parse`. 33 34 ## Flexibility 35 36 While still largely focused on content syndication, [the 37 spec](https://jsonfeed.org/version/1) includes support for plaintext and 38 title-less posts and custom extensions, meaning its potential uses are 39 myriad. Imagine a new generation of microblogs, Slack bots, and IoT 40 devices consuming and/or producing JSON feeds. 41 42 ## Feeds Are (Still) Cool 43 44 Not to get too high up on my horse or whatever, but as a longtime web 45 nerd, I'm dismayed by how much content creation has migrated to walled 46 gardens like Facebook/Instagram/Twitter/Medium that make it super easy 47 to get content *in*, but very difficult to get it back *out*. [Twitter 48 killed RSS in 2012](http://mashable.com/2012/09/05/twitter-api-rss), and 49 have you ever tried to get a list of your most recent Instagram photos 50 programmatically? I wouldn't. Owning your own content and sharing it 51 liberally is what the web was made for, and JSON Feed has the potential 52 to make it easy and fun to do. [It's how things should be. It's how they 53 could be.](https://www.youtube.com/watch?v=TgqiSBxvdws) 54 55 ------------------------------------------------------------------------ 56 57 ## Your Turn 58 59 If this sounds at all interesting to you, read the 60 [announcement](https://jsonfeed.org/2017/05/17/announcing_json_feed) and 61 the [spec](https://jsonfeed.org/version/1), listen to this [interview 62 with the 63 creators](https://daringfireball.net/thetalkshow/2017/05/31/ep-192), and 64 **try out this [JSON Feed 65 Validator](https://json-feed-validator.herokuapp.com/) I put up this 66 week**. You can use the [Daring Fireball 67 feed](https://daringfireball.net/feeds/json) or create your own. It's 68 pretty simple right now, running your input against a schema I 69 downloaded from [JSON Schema Store](http://schemastore.org/json/), but 70 [suggestions and pull requests are 71 welcome](https://github.com/vigetlabs/json-feed-validator). 72 73 [^1]: [The royal we, you know?](https://www.youtube.com/watch?v=VLR_TDO0FTg#t=45s)