Skip to content

Instantly share code, notes, and snippets.

@bishopZ
Last active December 27, 2015 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bishopZ/7393998 to your computer and use it in GitHub Desktop.
Save bishopZ/7393998 to your computer and use it in GitHub Desktop.
Spec Version 1.2
// Specification V1.1
// Collapsed namespace
// Common to all standards
// Saitized:
// Text only content
// URL rewriting
// Some type enforcement
// unescaped
// Encoding UTF-8
// JSONP wrapper
// as described by rssjs.org
jsonpHandler({
"feed": {
// the container object
// "channel" in RSS
// "value" in Yahoo Pipes
"feedUrl": "The URL for the feed.",
// SANITIZE: URL normalization to standardize feed URLs
// "cloud" in RSS 2.0
"title": "RSS to JSON pipe",
// The feed title.
// SANITIZE: No HTML
// <title> element in Atom, RSS, Yahoo Pipes
"link": "http://somedomain.com/page/123123",
// link to an HTML description of the feed
// SANITIZE: The URL for the HTML version of the feed.
"description":"Converts RSS to JSON, with user specified count and RSS URL.",
// The feed description
// SANITIZE: No HTML
// <subtitle> element in Atom
// "summary" in iTunes
// <description> element in RSS, Yahoo Pipes
"author": "",
// OPTIONAL
// The feed author.
// SANITIZE: No HTML
// <name> element for "author" in Atom
// <name> element for "owner" in iTunes
// credit role="author" in Media RSS
"language": "en-us",
// OPTIONAL
// the language of the post
// SANITIZE: No HTML
"tags": []
// An Array of Strings
// OPTIONAL
// SANITIZE: No HTML
// "categories" in Media RSS, iTunes
// "keywords" in iTunes
"lat": "",
"long": "",
// OPTIONAL
// SANITIZE: geo only
// lat and long in W3C Geo
"licence": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
// OPTIONAL
// default license for all items
// SANITIZE: URL normalization to standardize feed URLs
// license in Creative Commons
"media": [
// OPTIONAL
// An array of objects, A container for Media RSS media about the feed
// such as "thumbnail" in Media RSS
// such as "image" in iTunes, RSS
// Media Object
{
"url": "http://digg.com/xbox/New_Crysis_2_screens_will_literally_make_jaws_drop/t.jpg",
// REQUIRED
// SANITIZE: URL normalization to standardize feed URLs
// image.url in RSS
"link": "http://digg.com/xbox/",
// OPTIONAL
// link to an HTML description of the media object
// SANITIZE: URL normalization to standardize feed URLs
// image.link in RSS
"title": "Xbox Games",
// OPTIONAL
// SANITIZE: No HTML
// image.title in RSS
"type": "image/jpeg",
"medium": "image",
"length": "12974786",
// OPTIONAL
// SANITIZE: No HTML
// from Google Feed
"height": 80,
"width": 80
// OPTIONAL
// SANITIZE: number only
// from Google Feed
"value": ""
// OPTIONAL
// "#value" in RSS "enclosure"
}
],
"items": [
// An array of objects, list of all of the entries in the feed.
// "entries" in Google Feed API
// "item" in RSS
// "entry" in Atom
// Item Object
{
"title": "",
// The entry title.
// SANITIZE: No HTML
"link": "",
// link to an HTML description of the item
// SANITIZE: URL normalization to standardize feed URLs
"content": "",
// SANITIZE: No HTML
// <content> or <summary> elements in Atom
// <description> element in RSS, Media RSS
"publishedDate": "",
// OPTIONAL
// The string date on which the entry was published of the form "13 Apr 2007 12:40:07 -0700".
// You can parse the date with new Date(entry.publishedDate).
// SANITIZE: Javascript Date
// <published> element in Atom
// <pubDate> element in RSS, Yahoo Pipes
"author": "",
// OPTIONAL
// The author of the item
// SANITIZE: No HTML
"tags": []
// An Array of Strings
// OPTIONAL
// SANITIZE: No HTML
// "categories" in Google Feed API
"licence": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
// OPTIONAL
// License for the Item
// SANITIZE: URL normalization to standardize feed URLs
// license in Creative Commons
"media": [
// OPTIONAL
// An array of objects, A container for Media RSS feed results.
// "enclosure" in RSS
// Media Object
{
"url": "http://digg.com/xbox/New_Crysis_2_screens_will_literally_make_jaws_drop/t.jpg",
// REQUIRED
// SANITIZE: URL normalization to standardize feed URLs
// image.url in RSS
"link": "http://digg.com/xbox/",
// OPTIONAL
// link to an HTML description of the media object
// SANITIZE: URL normalization to standardize feed URLs
// image.link in RSS
"title": "Xbox Games",
// OPTIONAL
// SANITIZE: No HTML
// image.title in RSS
"type": "image/jpeg",
"medium": "image",
"length": "12974786",
// OPTIONAL
// SANITIZE: No HTML
// from Google Feed
"height": 80,
"width": 80
// OPTIONAL
// SANITIZE: number only
// from Google Feed
"value": ""
// OPTIONAL
// "#value" in RSS "enclosure"
}
]
}
]
}
});
// Specification V1.2
// Collapsed namespace
// Common to all standards
// Saitized:
// Text only content
// URL rewriting
// Some type enforcement
// unescaped
// Encoding UTF-8
jsonpHandler({
"feed": {
// required
"url": "The URL for the feed.",
"title": "RSS to JSON pipe",
// optional
"link": "http://somedomain.com/page/123123",
"description":"Converts RSS to JSON, with user specified count and RSS URL.",
"author": "",
"language": "en-us",
"tags": ['Media', 'News']
"lat": "",
"long": "",
"licence": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
"media": [{
// required
"url": "http://somedomain.com/t.jpg",
"title": "My Image",
// optional
"link": "http://somedomain.com/123123/",
"type": "image/jpeg",
"medium": "image",
"length": "12974786",
"height": 80,
"width": 80
"value": "010101100101110101010001010100010101101101010"
}],
"items": [{
// required
"title": "",
"content": "",
// optional
"link": "",
"publishedDate": "",
"author": "",
"tags": ['Media', 'News']
"licence": "http://creativecommons.org/licenses/by-nc-sa/2.0/",
"media": [{
// required
"url": "http://somedomain.com/t.jpg",
"title": "My Image",
// optional
"link": "http://somedomain.com/123123/",
"type": "image/jpeg",
"medium": "image",
"length": "12974786",
"height": 80,
"width": 80
"value": "010101100101110101010001010100010101101101010"
}]
}]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment