forked from jfhovinne/jFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
114 lines (89 loc) · 3.03 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
coffeed : jQuery feed parser plugin in CoffeeScript, with support for non-standard item tags
Copyright (C) 2011 Esteban Ignacio Invernizzi - [email protected]
Licensed under the MIT (MIT-license.txt) license.
based on...
+----------------------------------------------------------------------+
| jFeed : jQuery feed parser plugin |
| Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/ |
| Dual licensed under the MIT (MIT-license.txt) |
| and GPL (GPL-license.txt) licenses. |
| |
| http://hovinne.com/articles/jfeed-jquery-rss-atom-feed-parser-plugin |
+----------------------------------------------------------------------+
Usage
=====
jQuery.getFeed(options)
options:
* url: the feed URL (required).
* data: data to be sent to the server. See jQuery.ajax data property.
* success: a function to be called if the request succeeds.
The function gets passed one argument: the Coffeed object.
Example:
jQuery.getFeed
url: 'rss.xml'
success: (feed) ->
alert feed.title
Coffeed properties
================
* feed.type
* feed.version
* feed.title
* feed.link
* feed.description
* feed.language
* feed.updated
* feed.items: an array of CoffeedItem
CoffeedItem properties
====================
* item.title
* item.link
* item.description
* item.pubDate
* item.guid
* a property for every other tag name found inside each <item></item> block
Every property is an object with the structure:
property
|
+- text
+- attrs
where text is the text content of the tag, and attrs has a property for each
tag attribute of the same name.
For example, an item with the structure:
<item>
<title id="feed-1">Feed title</title>
</item>
will result in a CoffeedItem like:
{
title: {
text: "Feed title",
attrs: {
id: "feed-1"
}
}
}
Any property whose tagname is repeated inside an item block will be an
array containing an element for each one, in order of appearance. For example
for the item:
<item>
<link src="http://www.myfeed.com">My feed</link>
<link src="http://www.myotherfeed.com">My other feed</link>
</item>
the following CoffeedItem will be built:
{
link: [
{
text: "My feed",
attrs: {
src: "http://www.myfeed.com"
}
}, {
text: "My other feed",
attrs: {
src: "http://www.myotherfeed.com"
}
}
]
}
Please see the provided examples for more information.
A basic PHP proxy is also available (proxy.php), if you need to load external
feeds (for testing purposes only, do not use it on public websites).