A lax Web news feed parser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

261 lines
7.5 KiB

[
{
"description": "Minimal example 1",
"input": {
"version": "https://jsonfeed.org/version/1"
},
"output": {
"format": "json",
"version": "1"
}
},
{
"description": "Minimal example 2",
"input": {
"version": "https://jsonfeed.org/version/1.1"
},
"output": {
"format": "json",
"version": "1.1"
}
},
{
"description": "Correct type of member",
"input": {
"version": "https://jsonfeed.org/version/1",
"title": "Example title"
},
"output": {
"format": "json",
"version": "1",
"title": "Example title"
}
},
{
"description": "Incorrect type of member",
"input": {
"version": "https://jsonfeed.org/version/1",
"title": 1001001
},
"output": {
"format": "json",
"version": "1"
}
},
{
"description": "URL -> ID equivalence",
"input": {
"version": "https://jsonfeed.org/version/1",
"title": "Example title",
"feed_url": "http://example.com/"
},
"output": {
"format": "json",
"version": "1",
"title": "Example title",
"id": "http://example.com/",
"url": "http://example.com/"
}
},
{
"description": "Single author",
"input": {
"version": "https://jsonfeed.org/version/1",
"author": {"name": "John Doe", "url": "http://example.org/", "avatar": "http://example.org/avatar"}
},
"output": {
"format": "json",
"version": "1",
"people": [
{
"role": "author",
"name": "John Doe",
"url": "http://example.org/",
"avatar": "http://example.org/avatar"
}
]
}
},
{
"description": "Multiple authors",
"input": {
"version": "https://jsonfeed.org/version/1",
"authors": [
{"name": "John Doe", "url": "http://example.org/", "avatar": "http://example.org/avatar"},
{"name": "Jane Doe", "url": "http://example.net/", "avatar": "http://example.net/avatar"}
]
},
"output": {
"format": "json",
"version": "1",
"people": [
{
"role": "author",
"name": "John Doe",
"url": "http://example.org/",
"avatar": "http://example.org/avatar"
},
{
"role": "author",
"name": "Jane Doe",
"url": "http://example.net/",
"avatar": "http://example.net/avatar"
}
]
}
},
{
"description": "Fallback author",
"input": {
"version": "https://jsonfeed.org/version/1",
"authors": [
{"name": "John Doe", "url": "http://example.org/", "avatar": "http://example.org/avatar"},
{"name": "Jane Doe", "url": "http://example.net/", "avatar": "http://example.net/avatar"}
],
"author": {"name": "John Smith", "url": "http://example.biz/", "avatar": "http://example.biz/avatar"}
},
"output": {
"format": "json",
"version": "1",
"people": [
{
"role": "author",
"name": "John Doe",
"url": "http://example.org/",
"avatar": "http://example.org/avatar"
},
{
"role": "author",
"name": "Jane Doe",
"url": "http://example.net/",
"avatar": "http://example.net/avatar"
}
]
}
},
{
"description": "Empty author",
"input": {
"version": "https://jsonfeed.org/version/1",
"author": {}
},
"output": {
"format": "json",
"version": "1"
}
},
{
"description": "Empty authors",
"input": {
"version": "https://jsonfeed.org/version/1",
"authors": [{}]
},
"output": {
"format": "json",
"version": "1"
}
},
{
"description": "Empty authors with fallback",
"input": {
"version": "https://jsonfeed.org/version/1",
"authors": [{}],
"author": {"name": "John Doe", "url": "http://example.org/", "avatar": "http://example.org/avatar"}
},
"output": {
"format": "json",
"version": "1",
"people": [
{
"role": "author",
"name": "John Doe",
"url": "http://example.org/",
"avatar": "http://example.org/avatar"
}
]
}
},
{
"description": "Expired feed",
"input": {
"version": "https://jsonfeed.org/version/1",
"expired": true
},
"output": {
"format": "json",
"version": "1",
"sched": {
"expired": true
}
}
},
{
"description": "Not expired feed",
"input": {
"version": "https://jsonfeed.org/version/1",
"expired": false
},
"output": {
"format": "json",
"version": "1",
"sched": {
"expired": false
}
}
},
{
"description": "Invalidly expired feed",
"input": {
"version": "https://jsonfeed.org/version/1",
"expired": 1
},
"output": {
"format": "json",
"version": "1"
}
},
{
"description": "Basic example",
"input": {
"version": "https://jsonfeed.org/version/1",
"language": "en",
"title": "Example title",
"feed_url": "http://example.com/",
"home_page_url": "http://example.net/",
"description": "Example description",
"user_comment": "Example comment",
"next_url": "http://example.com/next",
"icon": "http://example.com/image",
"favicon": "http://example.com/icon"
},
"output": {
"format": "json",
"version": "1",
"lang": "en",
"title": "Example title",
"id": "http://example.com/",
"url": "http://example.com/",
"link": "http://example.net/",
"summary": "Example description",
"icon": "http://example.com/icon",
"image": "http://example.com/image"
}
},
{
"description": "Relative URL resolution",
"doc_url": "http://example.com",
"input": {
"version": "https://jsonfeed.org/version/1",
"feed_url": "feed.json"
},
"output": {
"meta": {
"url": "http://example.com"
},
"format": "json",
"version": "1",
"id": "feed.json",
"url": ["feed.json", "http://example.com"]
}
}
]