Selaa lähdekoodia

Added files from 1.0

Jean-François Hovinne 9 vuotta sitten
vanhempi
commit
cb0beb0626
25 muutettua tiedostoa jossa 2189 lisäystä ja 0 poistoa
  1. 278
    0
      GPL-license.txt
  2. 20
    0
      MIT-license.txt
  3. 40
    0
      Makefile
  4. 51
    0
      README
  5. 144
    0
      build/dist/jquery.jfeed.js
  6. 1
    0
      build/dist/jquery.jfeed.pack.js
  7. 467
    0
      build/packer/Pack.pm
  8. 207
    0
      build/packer/ParseMaster.pm
  9. 163
    0
      build/packer/jsPacker.pl
  10. 65
    0
      example-proxy.html
  11. 65
    0
      example.html
  12. 11
    0
      jquery/jquery.js
  13. 12
    0
      proxy.php
  14. 36
    0
      src/jatom.js
  15. 59
    0
      src/jfeed.js
  16. 11
    0
      src/jfeeditem.js
  17. 38
    0
      src/jrss.js
  18. 54
    0
      test-dist-packed.html
  19. 54
    0
      test-dist.html
  20. 64
    0
      test-src.html
  21. 157
    0
      xml/atom.xml
  22. 54
    0
      xml/rss-091.xml
  23. 38
    0
      xml/rss-092.xml
  24. 53
    0
      xml/rss-10.xml
  25. 47
    0
      xml/rss-20.xml

+ 278
- 0
GPL-license.txt Näytä tiedosto

@@ -0,0 +1,278 @@
1
+        GNU GENERAL PUBLIC LICENSE
2
+           Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+          Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Lesser General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+        GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+    b) Accompany it with a written offer, valid for at least three
143
+    years, to give any third party, for a charge no more than your
144
+    cost of physically performing source distribution, a complete
145
+    machine-readable copy of the corresponding source code, to be
146
+    distributed under the terms of Sections 1 and 2 above on a medium
147
+    customarily used for software interchange; or,
148
+
149
+    c) Accompany it with the information you received as to the offer
150
+    to distribute corresponding source code.  (This alternative is
151
+    allowed only for noncommercial distribution and only if you
152
+    received the program in object code or executable form with such
153
+    an offer, in accord with Subsection b above.)
154
+
155
+The source code for a work means the preferred form of the work for
156
+making modifications to it.  For an executable work, complete source
157
+code means all the source code for all modules it contains, plus any
158
+associated interface definition files, plus the scripts used to
159
+control compilation and installation of the executable.  However, as a
160
+special exception, the source code distributed need not include
161
+anything that is normally distributed (in either source or binary
162
+form) with the major components (compiler, kernel, and so on) of the
163
+operating system on which the executable runs, unless that component
164
+itself accompanies the executable.
165
+
166
+If distribution of executable or object code is made by offering
167
+access to copy from a designated place, then offering equivalent
168
+access to copy the source code from the same place counts as
169
+distribution of the source code, even though third parties are not
170
+compelled to copy the source along with the object code.
171
+
172
+  4. You may not copy, modify, sublicense, or distribute the Program
173
+except as expressly provided under this License.  Any attempt
174
+otherwise to copy, modify, sublicense or distribute the Program is
175
+void, and will automatically terminate your rights under this License.
176
+However, parties who have received copies, or rights, from you under
177
+this License will not have their licenses terminated so long as such
178
+parties remain in full compliance.
179
+
180
+  5. You are not required to accept this License, since you have not
181
+signed it.  However, nothing else grants you permission to modify or
182
+distribute the Program or its derivative works.  These actions are
183
+prohibited by law if you do not accept this License.  Therefore, by
184
+modifying or distributing the Program (or any work based on the
185
+Program), you indicate your acceptance of this License to do so, and
186
+all its terms and conditions for copying, distributing or modifying
187
+the Program or works based on it.
188
+
189
+  6. Each time you redistribute the Program (or any work based on the
190
+Program), the recipient automatically receives a license from the
191
+original licensor to copy, distribute or modify the Program subject to
192
+these terms and conditions.  You may not impose any further
193
+restrictions on the recipients' exercise of the rights granted herein.
194
+You are not responsible for enforcing compliance by third parties to
195
+this License.
196
+
197
+  7. If, as a consequence of a court judgment or allegation of patent
198
+infringement or for any other reason (not limited to patent issues),
199
+conditions are imposed on you (whether by court order, agreement or
200
+otherwise) that contradict the conditions of this License, they do not
201
+excuse you from the conditions of this License.  If you cannot
202
+distribute so as to satisfy simultaneously your obligations under this
203
+License and any other pertinent obligations, then as a consequence you
204
+may not distribute the Program at all.  For example, if a patent
205
+license would not permit royalty-free redistribution of the Program by
206
+all those who receive copies directly or indirectly through you, then
207
+the only way you could satisfy both it and this License would be to
208
+refrain entirely from distribution of the Program.
209
+
210
+If any portion of this section is held invalid or unenforceable under
211
+any particular circumstance, the balance of the section is intended to
212
+apply and the section as a whole is intended to apply in other
213
+circumstances.
214
+
215
+It is not the purpose of this section to induce you to infringe any
216
+patents or other property right claims or to contest validity of any
217
+such claims; this section has the sole purpose of protecting the
218
+integrity of the free software distribution system, which is
219
+implemented by public license practices.  Many people have made
220
+generous contributions to the wide range of software distributed
221
+through that system in reliance on consistent application of that
222
+system; it is up to the author/donor to decide if he or she is willing
223
+to distribute software through any other system and a licensee cannot
224
+impose that choice.
225
+
226
+This section is intended to make thoroughly clear what is believed to
227
+be a consequence of the rest of this License.
228
+
229
+  8. If the distribution and/or use of the Program is restricted in
230
+certain countries either by patents or by copyrighted interfaces, the
231
+original copyright holder who places the Program under this License
232
+may add an explicit geographical distribution limitation excluding
233
+those countries, so that distribution is permitted only in or among
234
+countries not thus excluded.  In such case, this License incorporates
235
+the limitation as if written in the body of this License.
236
+
237
+  9. The Free Software Foundation may publish revised and/or new versions
238
+of the General Public License from time to time.  Such new versions will
239
+be similar in spirit to the present version, but may differ in detail to
240
+address new problems or concerns.
241
+
242
+Each version is given a distinguishing version number.  If the Program
243
+specifies a version number of this License which applies to it and "any
244
+later version", you have the option of following the terms and conditions
245
+either of that version or of any later version published by the Free
246
+Software Foundation.  If the Program does not specify a version number of
247
+this License, you may choose any version ever published by the Free Software
248
+Foundation.
249
+
250
+  10. If you wish to incorporate parts of the Program into other free
251
+programs whose distribution conditions are different, write to the author
252
+to ask for permission.  For software which is copyrighted by the Free
253
+Software Foundation, write to the Free Software Foundation; we sometimes
254
+make exceptions for this.  Our decision will be guided by the two goals
255
+of preserving the free status of all derivatives of our free software and
256
+of promoting the sharing and reuse of software generally.
257
+
258
+          NO WARRANTY
259
+
260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+REPAIR OR CORRECTION.
269
+
270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+POSSIBILITY OF SUCH DAMAGES.

+ 20
- 0
MIT-license.txt Näytä tiedosto

@@ -0,0 +1,20 @@
1
+Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/
2
+
3
+Permission is hereby granted, free of charge, to any person obtaining
4
+a copy of this software and associated documentation files (the
5
+"Software"), to deal in the Software without restriction, including
6
+without limitation the rights to use, copy, modify, merge, publish,
7
+distribute, sublicense, and/or sell copies of the Software, and to
8
+permit persons to whom the Software is furnished to do so, subject to
9
+the following conditions:
10
+
11
+The above copyright notice and this permission notice shall be
12
+included in all copies or substantial portions of the Software.
13
+
14
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 40
- 0
Makefile Näytä tiedosto

@@ -0,0 +1,40 @@
1
+SRC_DIR = src
2
+BUILD_DIR = build
3
+
4
+JS_FILES = ${SRC_DIR}/jfeed.js\
5
+ ${SRC_DIR}/jfeeditem.js\
6
+ ${SRC_DIR}/jatom.js\
7
+ ${SRC_DIR}/jrss.js
8
+
9
+WE = ${BUILD_DIR}/dist/jquery.jfeed.js
10
+WE_PACK = ${BUILD_DIR}/dist/jquery.jfeed.pack.js
11
+WE_ARCH = ../jquery.jfeed.tar.gz
12
+
13
+MERGE = sed -s -e '1 s/^\xEF\xBB\xBF//' ${JS_FILES} > ${WE}
14
+PACKER = perl -I${BUILD_DIR}/packer ${BUILD_DIR}/packer/jsPacker.pl -i ${WE} -o ${WE_PACK} -e62
15
+
16
+all: archive
17
+
18
+jfeed:
19
+	@@echo "Building" ${WE}
20
+
21
+	@@echo " - Merging files"
22
+	@@${MERGE}
23
+
24
+	@@echo ${WE} "Built"
25
+	@@echo
26
+
27
+pack: jfeed
28
+	@@echo "Building" ${WE_PACK}
29
+
30
+	@@echo " - Compressing using Packer"
31
+	@@${PACKER}
32
+
33
+	@@echo ${WE_PACK} "Built"
34
+	@@echo
35
+
36
+archive: pack
37
+	@@echo "Building" ${WE_ARCH}
38
+
39
+	@@echo " - Creating archive"
40
+	@@tar -C .. -czf ${WE_ARCH} --exclude '.svn' jfeed

+ 51
- 0
README Näytä tiedosto

@@ -0,0 +1,51 @@
1
+jFeed : jQuery feed parser plugin
2
+Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/
3
+Dual licensed under the MIT (MIT-license.txt)
4
+and GPL (GPL-license.txt) licenses.
5
+
6
+Usage
7
+=====
8
+
9
+    jQuery.getFeed(options);
10
+    
11
+    options:
12
+    
13
+    * url: the feed URL (required).
14
+    * data: data to be sent to the server. See jQuery.ajax data property.
15
+    * success: a function to be called if the request succeeds.
16
+      The function gets passed one argument: the JFeed object.
17
+    
18
+    Example:
19
+    
20
+    jQuery.getFeed({
21
+        url: 'rss.xml',
22
+        success: function(feed) {
23
+            alert(feed.title);
24
+        }
25
+    });
26
+    
27
+JFeed properties
28
+================
29
+
30
+    * feed.type
31
+    * feed.version
32
+    * feed.title
33
+    * feed.link
34
+    * feed.description
35
+    * feed.language
36
+    * feed.updated
37
+    * feed.items: an array of JFeedItem
38
+    
39
+JFeedItem properties
40
+====================
41
+
42
+    * item.title
43
+    * item.link
44
+    * item.description
45
+    * item.updated
46
+    * item.id
47
+
48
+Please see the provided examples for more information.
49
+
50
+A basic PHP proxy is also available (proxy.php), if you need to load external
51
+feeds (for testing purposes only, do not use it on public websites).

+ 144
- 0
build/dist/jquery.jfeed.js Näytä tiedosto

@@ -0,0 +1,144 @@
1
+/* jFeed : jQuery feed parser plugin
2
+ * Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/
3
+ * Dual licensed under the MIT (MIT-license.txt)
4
+ * and GPL (GPL-license.txt) licenses.
5
+ */
6
+
7
+jQuery.getFeed = function(options) {
8
+
9
+    options = jQuery.extend({
10
+    
11
+        url: null,
12
+        data: null,
13
+        success: null
14
+        
15
+    }, options);
16
+
17
+    if(options.url) {
18
+
19
+        $.ajax({
20
+            type: 'GET',
21
+            url: options.url,
22
+            data: options.data,
23
+            dataType: 'xml',
24
+            success: function(xml) {
25
+                var feed = new JFeed(xml);
26
+                if(jQuery.isFunction(options.success)) options.success(feed);
27
+            }
28
+        });
29
+    }
30
+};
31
+
32
+function JFeed(xml) {
33
+    if(xml) this.parse(xml);
34
+};
35
+
36
+JFeed.prototype = {
37
+
38
+    type: '',
39
+    version: '',
40
+    title: '',
41
+    link: '',
42
+    description: '',
43
+    parse: function(xml) {
44
+        
45
+        if(jQuery('channel', xml).length == 1) {
46
+        
47
+            this.type = 'rss';
48
+            var feedClass = new JRss(xml);
49
+
50
+        } else if(jQuery('feed', xml).length == 1) {
51
+        
52
+            this.type = 'atom';
53
+            var feedClass = new JAtom(xml);
54
+        }
55
+        
56
+        if(feedClass) jQuery.extend(this, feedClass);
57
+    }
58
+};
59
+
60
+function JFeedItem() {};
61
+
62
+JFeedItem.prototype = {
63
+
64
+    title: '',
65
+    link: '',
66
+    description: '',
67
+    updated: '',
68
+    id: ''
69
+};
70
+
71
+function JAtom(xml) {
72
+    this._parse(xml);
73
+};
74
+
75
+JAtom.prototype = {
76
+    
77
+    _parse: function(xml) {
78
+    
79
+        var channel = jQuery('feed', xml).eq(0);
80
+
81
+        this.version = '1.0';
82
+        this.title = jQuery(channel).find('title:first').text();
83
+        this.link = jQuery(channel).find('link:first').attr('href');
84
+        this.description = jQuery(channel).find('subtitle:first').text();
85
+        this.language = jQuery(channel).attr('xml:lang');
86
+        this.updated = jQuery(channel).find('updated:first').text();
87
+        
88
+        this.items = new Array();
89
+        
90
+        var feed = this;
91
+        
92
+        jQuery('entry', xml).each( function() {
93
+        
94
+            var item = new JFeedItem();
95
+            
96
+            item.title = jQuery(this).find('title').eq(0).text();
97
+            item.link = jQuery(this).find('link').eq(0).attr('href');
98
+            item.description = jQuery(this).find('content').eq(0).text();
99
+            item.updated = jQuery(this).find('updated').eq(0).text();
100
+            item.id = jQuery(this).find('id').eq(0).text();
101
+            
102
+            feed.items.push(item);
103
+        });
104
+    }
105
+};
106
+
107
+function JRss(xml) {
108
+    this._parse(xml);
109
+};
110
+
111
+JRss.prototype  = {
112
+    
113
+    _parse: function(xml) {
114
+    
115
+        if(jQuery('rss', xml).length == 0) this.version = '1.0';
116
+        else this.version = jQuery('rss', xml).eq(0).attr('version');
117
+
118
+        var channel = jQuery('channel', xml).eq(0);
119
+    
120
+        this.title = jQuery(channel).find('title:first').text();
121
+        this.link = jQuery(channel).find('link:first').text();
122
+        this.description = jQuery(channel).find('description:first').text();
123
+        this.language = jQuery(channel).find('language:first').text();
124
+        this.updated = jQuery(channel).find('lastBuildDate:first').text();
125
+    
126
+        this.items = new Array();
127
+        
128
+        var feed = this;
129
+        
130
+        jQuery('item', xml).each( function() {
131
+        
132
+            var item = new JFeedItem();
133
+            
134
+            item.title = jQuery(this).find('title').eq(0).text();
135
+            item.link = jQuery(this).find('link').eq(0).text();
136
+            item.description = jQuery(this).find('description').eq(0).text();
137
+            item.updated = jQuery(this).find('pubDate').eq(0).text();
138
+            item.id = jQuery(this).find('guid').eq(0).text();
139
+            
140
+            feed.items.push(item);
141
+        });
142
+    }
143
+};
144
+

+ 1
- 0
build/dist/jquery.jfeed.pack.js Näytä tiedosto

@@ -0,0 +1 @@
1
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3.X=a(h){h=3.J({v:D,C:D,u:D},h);k(h.v){$.W({t:\'V\',v:h.v,C:h.C,U:\'4\',u:a(4){d f=j B(4);k(3.T(h.u))h.u(f)}})}};a B(4){k(4)2.K(4)};B.r={t:\'\',l:\'\',c:\'\',b:\'\',g:\'\',K:a(4){k(3(\'8\',4).y==1){2.t=\'x\';d s=j z(4)}H k(3(\'f\',4).y==1){2.t=\'S\';d s=j A(4)}k(s)3.J(2,s)}};a o(){};o.r={c:\'\',b:\'\',g:\'\',i:\'\',n:\'\'};a A(4){2.q(4)};A.r={q:a(4){d 8=3(\'f\',4).9(0);2.l=\'1.0\';2.c=3(8).5(\'c:e\').6();2.b=3(8).5(\'b:e\').p(\'I\');2.g=3(8).5(\'R:e\').6();2.w=3(8).p(\'4:Q\');2.i=3(8).5(\'i:e\').6();2.m=j G();d f=2;3(\'P\',4).F(a(){d 7=j o();7.c=3(2).5(\'c\').9(0).6();7.b=3(2).5(\'b\').9(0).p(\'I\');7.g=3(2).5(\'O\').9(0).6();7.i=3(2).5(\'i\').9(0).6();7.n=3(2).5(\'n\').9(0).6();f.m.E(7)})}};a z(4){2.q(4)};z.r={q:a(4){k(3(\'x\',4).y==0)2.l=\'1.0\';H 2.l=3(\'x\',4).9(0).p(\'l\');d 8=3(\'8\',4).9(0);2.c=3(8).5(\'c:e\').6();2.b=3(8).5(\'b:e\').6();2.g=3(8).5(\'g:e\').6();2.w=3(8).5(\'w:e\').6();2.i=3(8).5(\'N:e\').6();2.m=j G();d f=2;3(\'7\',4).F(a(){d 7=j o();7.c=3(2).5(\'c\').9(0).6();7.b=3(2).5(\'b\').9(0).6();7.g=3(2).5(\'g\').9(0).6();7.i=3(2).5(\'M\').9(0).6();7.n=3(2).5(\'L\').9(0).6();f.m.E(7)})}};',60,60,'||this|jQuery|xml|find|text|item|channel|eq|function|link|title|var|first|feed|description|options|updated|new|if|version|items|id|JFeedItem|attr|_parse|prototype|feedClass|type|success|url|language|rss|length|JRss|JAtom|JFeed|data|null|push|each|Array|else|href|extend|parse|guid|pubDate|lastBuildDate|content|entry|lang|subtitle|atom|isFunction|dataType|GET|ajax|getFeed'.split('|')))

+ 467
- 0
build/packer/Pack.pm Näytä tiedosto

@@ -0,0 +1,467 @@
1
+#Pack (July 2005)
2
+#  Based on "Pack.js" by Dean Edwards <http://dean.edwards.name/>
3
+#  Ported to Perl by Rob Seiler, ELR Software Pty Ltd <http://www.elr.com.au>
4
+#  Copyright 2005. License <http://creativecommons.org/licenses/LGPL/2.1/>
5
+
6
+package Pack;
7
+use strict;
8
+use Data::Dumper;
9
+
10
+use ParseMaster;
11
+
12
+# Package wide variable declarations
13
+use vars qw/$VERSION $PM_VERSION
14
+            $_X_encodePrivate $_JSunpack $_JSdecode %baseLookup
15
+            $_X_encode10 $_X_encode36 $_X_encode62 $_X_encode95
16
+            $_JSencode10 $_JSencode36 $_JSencode62 $_JSencode95
17
+            @_X_parsers
18
+            $_X_script $_X_encoding $_X_fastDecode $_X_specialChars
19
+           /;
20
+$VERSION    = '024';
21
+$PM_VERSION = $ParseMaster::VERSION;
22
+
23
+# Package wide constants
24
+my $X_IGNORE  = q{$1};
25
+my $X_ENCODE  = q/\x24encode\(\x24count\)/;  # NB: requires g modifier
26
+my $PERL      = 'perl';     # Flag to indicate whether we need to use one of our "internal" Perl encoding functions
27
+my $JSCRIPT   = 'jscript';  # or embed a pre-build JScript encoding function
28
+########################################
29
+
30
+##################
31
+sub pack($$$$) { # require 4 arguments
32
+##################
33
+#print Dumper(@_);
34
+  ($_X_script, $_X_encoding, $_X_fastDecode, $_X_specialChars) = @_;
35
+  # validate parameters (sort of!)
36
+  $_X_script  .= "\n";
37
+  $_X_encoding = ($_X_encoding > 95) ? 95 : $_X_encoding;
38
+
39
+  @_X_parsers = (); # Reset parsers
40
+
41
+####################
42
+  sub _X_pack($) { # require 1 argument
43
+####################
44
+  # apply all parsing routines
45
+    my $X_script = shift;
46
+    for (my $i = 0; $i<scalar(@_X_parsers); $i++) {
47
+      my $X_parse = $_X_parsers[$i];
48
+       $X_script = &$X_parse($X_script);
49
+    }
50
+    return $X_script;
51
+  };
52
+
53
+######################
54
+  sub _X_addParser { #
55
+######################
56
+  # keep a list of parsing functions, they'll be executed all at once
57
+    my $X_parser = shift;
58
+    push (@_X_parsers,$X_parser);
59
+  }
60
+
61
+#############################
62
+  sub _X_basicCompression { #
63
+#############################
64
+    # zero encoding - just removal of white space and comments
65
+    my $X_script = shift;
66
+    my $parser = ParseMaster->new();
67
+    # make safe
68
+    $parser->escapeChar("\\");
69
+    # protect strings
70
+    $parser->add(q/'[^'\n\r]*'/, $X_IGNORE);
71
+    $parser->add(q/"[^"\n\r]*"/, $X_IGNORE);
72
+    # remove comments
73
+    $parser->add(q/\/\/[^\n\r]*[\n\r]/);
74
+    $parser->add(q/\/\*[^*]*\*+([^\/][^*]*\*+)*\//);
75
+    # protect regular expressions
76
+    $parser->add(q/\s+(\/[^\/\n\r\*][^\/\n\r]*\/g?i?)/, q{$2}); # IGNORE
77
+    $parser->add(q/[^\w\x24\/'"*)\?:]\/[^\/\n\r\*][^\/\n\r]*\/g?i?/, $X_IGNORE);
78
+    # remove: ;;; doSomething();
79
+    $parser->add(q/;;[^\n\r]+[\n\r]/) if ($_X_specialChars);
80
+    # remove redundant semi-colons
81
+    $parser->add(q/;+\s*([};])/, q{$2});
82
+    # remove white-space
83
+    $parser->add(q/(\b|\x24)\s+(\b|\x24)/, q{$2 $3});
84
+    $parser->add(q/([+\-])\s+([+\-])/, q{$2 $3});
85
+    $parser->add(q/\s+/, '');
86
+    # done
87
+    return $parser->exec($X_script);
88
+  }
89
+
90
+###############################
91
+  sub _X_encodeSpecialChars { #
92
+###############################
93
+    my $X_script = shift;
94
+    my $parser = ParseMaster->new();
95
+    # replace: $name -> n, $$name -> $$na
96
+    $parser->add(q/((\x24+)([a-zA-Z\x24_]+))(\d*)/,
97
+      sub {
98
+        my $X_offset   = pop;
99
+        my @X_match    = @_;
100
+        my $X_length   = length($X_match[$X_offset+2]);
101
+        my $lengthnext = length($X_match[$X_offset+3]);
102
+        my $X_start = $X_length - ((($X_length - $lengthnext) > 0) ? ($X_length - $lengthnext) : 0);
103
+        my $str = $X_match[$X_offset+1];
104
+        $str = substr($str,$X_start,$X_length) . $X_match[$X_offset+4];
105
+        return "$str";
106
+      });
107
+     # replace: _name -> _0, double-underscore (__name) is ignored
108
+     my $X_regexp = q/\b_[A-Za-z\d]\w*/;
109
+     # build the word list
110
+     my %X_keywords = &_X_analyze($X_script, $X_regexp, $_X_encodePrivate);
111
+#print Dumper(%X_keywords);
112
+     # quick ref
113
+     my $X_encoded = \$X_keywords{X_encoded}; # eg _private1 => '_0',_private2 => '_1';
114
+#print Dumper($X_encoded);
115
+     $parser->add($X_regexp, sub {my $X_offset = pop; my @X_match = @_; return ${$X_encoded}->{$X_match[$X_offset]};});
116
+
117
+     return $parser->exec($X_script);
118
+  };
119
+
120
+###########################
121
+  sub _X_encodeKeywords { #
122
+###########################
123
+    my $X_script = shift;
124
+    # escape high-ascii values already in the script (i.e. in strings)
125
+    if ($_X_encoding > 62) {$X_script = &_X_escape95($X_script)};
126
+    # create the parser
127
+    my $parser = ParseMaster->new();
128
+    my $X_encode = &_X_getEncoder($_X_encoding,$PERL);
129
+    # for high-ascii, don't encode single character low-ascii
130
+    my $X_regexp = ($_X_encoding > 62) ? q/\w\w+/ : q/\w+/;
131
+    # build the word list
132
+    my %X_keywords = &_X_analyze($X_script, $X_regexp, $X_encode);
133
+#print Dumper(%X_keywords);
134
+    my $X_encoded = \$X_keywords{X_encoded}; # eg alert => 2, function => 10 etc
135
+    # encode
136
+    $parser->add($X_regexp, sub {my $X_offset = pop; my @X_match = @_; return ${$X_encoded}->{$X_match[$X_offset]};});
137
+    # if encoded, wrap the script in a decoding function
138
+
139
+    return $X_script && _X_bootStrap(\$parser->exec($X_script), \%X_keywords);
140
+  }
141
+
142
+####################
143
+  sub _X_analyze { #
144
+####################
145
+#print Dumper(@_);
146
+    my ($X_script, $X_regexp, $X_encode) = @_;
147
+    # analyse
148
+    # retreive all words in the script
149
+    my @X_all = $X_script =~ m/$X_regexp/g; # Save all captures in a list context
150
+    my %XX_sorted    = ();  # list of words sorted by frequency
151
+    my %XX_encoded   = ();  # dictionary of word->encoding
152
+    my %XX_protected = ();  # instances of "protected" words
153
+    if (@X_all) {
154
+      my @X_unsorted  = (); # same list, not sorted
155
+      my %X_protected = (); # "protected" words (dictionary of word->"word")
156
+      my %X_values    = (); # dictionary of charCode->encoding (eg. 256->ff)
157
+      my %X_count     = (); # word->count
158
+      my $i = scalar(@X_all); my $j = 0; my $X_word = '';
159
+      # count the occurrences - used for sorting later
160
+      do {
161
+        $X_word = '$' . $X_all[--$i];
162
+        if (!exists($X_count{$X_word})) {
163
+          $X_count{$X_word}   = [0,$i]; # Store both the usage count and original array position (ie a secondary sort key)
164
+          $X_unsorted[$j]   = $X_word;
165
+          # make a dictionary of all of the protected words in this script
166
+          #   these are words that might be mistaken for encoding
167
+          $X_values{$j}     = &$X_encode($j);
168
+          my $v           = '$'.$X_values{$j};
169
+          $X_protected{$v}  = $j++;
170
+        }
171
+        # increment the word counter
172
+        $X_count{$X_word}[0]++;
173
+      } while ($i);
174
+#print Dumper (%X_values);
175
+#print Dumper (@X_unsorted);
176
+#print Dumper (%X_protected);
177
+      # prepare to sort the word list, first we must protect
178
+      #  words that are also used as codes. we assign them a code
179
+      #  equivalent to the word itself.
180
+      # e.g. if "do" falls within our encoding range
181
+      #       then we store keywords["do"] = "do";
182
+      # this avoids problems when decoding
183
+       $i = scalar(@X_unsorted);
184
+      do {
185
+        $X_word = $X_unsorted[--$i];
186
+        if (exists($X_protected{$X_word})) {
187
+          $XX_sorted{$X_protected{$X_word}} = substr($X_word,1);
188
+          $XX_protected{$X_protected{$X_word}} = 1; # true
189
+          $X_count{$X_word}[0] = 0;
190
+        }
191
+      } while ($i);
192
+#print Dumper (%XX_protected);
193
+#print Dumper (%XX_sorted);
194
+#print Dumper (%X_count);
195
+      # sort the words by frequency
196
+      # Sort with count a primary key and original array order as secondary key - which is apparently the default in javascript!
197
+      @X_unsorted = sort ({($X_count{$b}[0] - $X_count{$a}[0]) or ($X_count{$b}[1] <=> $X_count{$a}[1])} @X_unsorted);
198
+#print Dumper (@X_unsorted) . "\n";
199
+
200
+      $j = 0;
201
+      # because there are "protected" words in the list
202
+      # we must add the sorted words around them
203
+      do {
204
+        if (!exists($XX_sorted{$i})) {$XX_sorted{$i} = substr($X_unsorted[$j++],1)}
205
+        $XX_encoded{$XX_sorted{$i}} = $X_values{$i};
206
+      } while (++$i < scalar(@X_unsorted));
207
+    }
208
+#print Dumper(X_sorted => \%XX_sorted, X_encoded => \%XX_encoded, X_protected => \%XX_protected);
209
+    return (X_sorted => \%XX_sorted, X_encoded => \%XX_encoded, X_protected => \%XX_protected);
210
+  }
211
+
212
+######################
213
+  sub _X_bootStrap { #
214
+######################
215
+    # build the boot function used for loading and decoding
216
+    my ($X_packed, $X_keywords) = @_; # Reference arguments!
217
+#print Dumper ($X_keywords) . "\n";
218
+
219
+    # $packed: the packed script - dereference and escape
220
+    $X_packed = "'" . &_X_escape($$X_packed) ."'";
221
+
222
+    my %sorted    = %{$$X_keywords{X_sorted}};    # Dereference to local variables
223
+    my %protected = %{$$X_keywords{X_protected}}; # for simplicity
224
+
225
+    my @sorted    = ();
226
+    foreach my $key (keys %sorted) {$sorted[$key] = $sorted{$key}}; # Convert hash to a standard list
227
+
228
+    # ascii: base for encoding
229
+    my $X_ascii = ((scalar(@sorted) > $_X_encoding) ? $_X_encoding : scalar(@sorted)) || 1;
230
+
231
+    # count: number of (unique {RS}) words contained in the script
232
+    my $X_count = scalar(@sorted); # Use $X_count for assigning $X_ascii
233
+
234
+    # keywords: list of words contained in the script
235
+    foreach my $i (keys %protected) {$sorted[$i] = ''}; # Blank out protected words
236
+#print Dumper(@sorted) . "\n";
237
+
238
+    # convert from a string to an array - prepare keywords as a JScript string->array {RS}
239
+    $X_keywords = "'" . join('|',@sorted) . "'.split('|')";
240
+
241
+    # encode: encoding function (used for decoding the script)
242
+    my $X_encode = $_X_encoding > 62 ? $_JSencode95 : &_X_getEncoder($X_ascii,$JSCRIPT); # This is a JScript function (as a string)
243
+       $X_encode =~ s/_encoding/\x24ascii/g; $X_encode =~ s/arguments\.callee/\x24encode/g;
244
+    my $X_inline = '$count' . ($X_ascii > 10 ? '.toString($ascii)' : '');
245
+
246
+    # decode: code snippet to speed up decoding
247
+    my $X_decode = '';
248
+    if ($_X_fastDecode) {
249
+      # create the decoder
250
+      $X_decode = &_X_getFunctionBody($_JSdecode); # ie from the Javascript literal function
251
+      if ($_X_encoding > 62) {$X_decode =~ s/\\\\w/[\\xa1-\\xff]/g}
252
+      # perform the encoding inline for lower ascii values
253
+      elsif ($X_ascii < 36) {$X_decode =~ s/$X_ENCODE/$X_inline/g}
254
+      # special case: when $X_count==0 there ar no keywords. i want to keep
255
+      # the basic shape of the unpacking funcion so i'll frig the code...
256
+      if (!$X_count) {$X_decode =~ s/(\x24count)\s*=\s*1/$1=0/}
257
+    }
258
+
259
+    # boot function
260
+    my $X_unpack = $_JSunpack;
261
+    if ($_X_fastDecode) {
262
+      # insert the decoder
263
+      $X_unpack =~ s/\{/\{$X_decode;/;
264
+    }
265
+    $X_unpack =~ s/"/'/g;
266
+    if ($_X_encoding > 62) { # high-ascii
267
+      # get rid of the word-boundaries for regexp matches
268
+      $X_unpack =~ s/'\\\\b'\s*\+|\+\s*'\\\\b'//g; # Not checked! {RS}
269
+    }
270
+    if ($X_ascii > 36 || $_X_encoding > 62 || $_X_fastDecode) {
271
+    # insert the encode function
272
+    $X_unpack =~ s/\{/\{\$encode=$X_encode;/;
273
+    } else {
274
+      # perform the encoding inline
275
+      $X_unpack =~ s/$X_ENCODE/$X_inline/;
276
+    }
277
+
278
+    # arguments   {RS} Do this before using &pack because &pack changes the pack parameters (eg $fastDecode) in Perl!!
279
+    my $X_params = "$X_packed,$X_ascii,$X_count,$X_keywords"; # Interpolate to comma separated string
280
+    if ($_X_fastDecode) {
281
+      # insert placeholders for the decoder
282
+      $X_params .= ',0,{}';
283
+    }
284
+
285
+    # pack the boot function too
286
+    $X_unpack = &pack($X_unpack,0,0,1);
287
+
288
+    # the whole thing
289
+    return "eval(" . $X_unpack . "(" . $X_params . "))\n";
290
+  };
291
+
292
+#######################
293
+  sub _X_getEncoder { #
294
+#######################
295
+  # mmm.. ..which one do i need ?? ({RS} Perl or JScript ??)
296
+    my ($X_ascii,$language) = @_;
297
+    my $perl_encoder    = ($X_ascii > 10) ? ($X_ascii > 36) ? ($X_ascii > 62) ? $_X_encode95 : $_X_encode62 : $_X_encode36 : $_X_encode10;
298
+    my $jscript_encoder = ($X_ascii > 10) ? ($X_ascii > 36) ? ($X_ascii > 62) ? $_JSencode95 : $_JSencode62 : $_JSencode36 : $_JSencode10;
299
+    return ($language eq $JSCRIPT) ? $jscript_encoder : $perl_encoder;
300
+  };
301
+
302
+#############################
303
+# Perl versions of encoders #
304
+#############################
305
+  # base10 zero encoding - characters: 0123456789
306
+  $_X_encode10 = sub {return &_encodeBase(shift,10)};
307
+  # base36               - characters: 0123456789abcdefghijklmnopqrstuvwxyz
308
+  $_X_encode36 = sub {return &_encodeBase(shift,36)};
309
+  # base62               - characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
310
+  $_X_encode62 = sub {return &_encodeBase(shift,62)};
311
+  # high-ascii values    - characters: 、�ウЖ��⑭�渦慨偽係杭纂従神疎団兎波品北洋椀冫嘖孛忤掣桀毳烙痰邃繙艾蜉謖邇關髓齡��巐鄕�
312
+  $_X_encode95 = sub {return &_encodeBase(shift,95)};
313
+  # Lookup character sets for baseN encoding
314
+     $baseLookup{10} = [(0..9)[0..9]];                    # base 10
315
+     $baseLookup{36} = [(0..9,'a'..'z')[0..35]];          # base 36
316
+     $baseLookup{62} = [(0..9,'a'..'z','A'..'Z')[0..61]]; # base 62
317
+     $baseLookup{95} = (); for (my $i=0; $i<95; $i++) {$baseLookup{95}[$i] = chr($i+161)}; # base95 (high ascii)
318
+#print Dumper(%baseLookup);
319
+#####################
320
+  sub _encodeBase { #
321
+#####################
322
+  # Generic base conversion function using defined lookup arrays (perl version only)
323
+    my ($X_charCode, $base) = @_;
324
+    my $X_encoded = '';
325
+    # Do we know this encoding?
326
+    if (exists ($baseLookup{$base})) {
327
+      if ($X_charCode == 0) {$X_encoded = $baseLookup{$base}[0]}
328
+      while($X_charCode > 0) {
329
+        $X_encoded  = $baseLookup{$base}[$X_charCode % $base] . $X_encoded;
330
+        $X_charCode = int($X_charCode / $base);
331
+      }
332
+    }
333
+    else {$X_encoded = "$X_charCode"} # default is to return unchanged (ie as for base 10) if no baselookup is available
334
+    return $X_encoded;
335
+  };
336
+
337
+#############################
338
+  $_X_encodePrivate = sub { #
339
+#############################
340
+  # special _chars
341
+    my $X_charCode = shift;
342
+    return '_' . $X_charCode;
343
+  };
344
+
345
+############################
346
+  sub _X_escape($script) { #
347
+############################
348
+  # protect characters used by the parser
349
+    my $X_script = shift;
350
+    $X_script =~ s/([\\'])/\\$1/g;
351
+    return $X_script;
352
+  };
353
+
354
+#####################
355
+  sub _X_escape95 { #
356
+#####################
357
+  # protect high-ascii characters already in the script
358
+    my $X_script = shift;
359
+    $X_script =~ s/([\xa1-\xff])/sprintf("\\x%1x",ord($1))/eg;
360
+    return $X_script;
361
+  };
362
+
363
+############################
364
+  sub _X_getFunctionBody { #
365
+############################
366
+  # extract the body of a function (ie between opening/closing {}) - consistent with Dean Edwards approach
367
+    my $X_function = shift;
368
+    $X_function =~ m/^.*\{(.*)\}*$/sg; # Multiline, global (greedy)
369
+    my $start = index($X_function,'{');
370
+    my $end   = rindex($X_function,'}');
371
+    $X_function = substr($X_function,($start+1),($end-1-$start));
372
+    return $X_function;
373
+  };
374
+
375
+######################
376
+  sub _X_globalize { #
377
+######################
378
+  # set the global flag on a RegExp (you have to create a new one) !!! Unused in perl version
379
+    # my $X_regexp = shift;
380
+  };
381
+
382
+  # build the parsing routine
383
+  &_X_addParser(\&_X_basicCompression);
384
+  &_X_addParser(\&_X_encodeSpecialChars) if ($_X_specialChars);
385
+  &_X_addParser(\&_X_encodeKeywords)     if ($_X_encoding);
386
+
387
+  # go!
388
+  return &_X_pack($_X_script);
389
+}
390
+
391
+########################
392
+# Javascript Literals  #
393
+########################
394
+
395
+# JScript function "_unpack" - from DeanEdwards pack.js (NB: No ";" after final "}")
396
+($_JSunpack) = <<'END_JSCRIPT_UNPACK';
397
+/* unpacking function - this is the boot strap function   */
398
+/* data extracted from this packing routine is passed to  */
399
+/* this function when decoded in the target               */
400
+function($packed, $ascii, $count, $keywords, $encode, $decode) {
401
+  while ($count--)
402
+    if ($keywords[$count])
403
+     $packed = $packed.replace(new RegExp('\\b' + $encode($count) + '\\b', 'g'), $keywords[$count]);
404
+  /* RS_Debug = $packed; */  /* {RS} !!!!!!!!! */
405
+  return $packed;
406
+}
407
+END_JSCRIPT_UNPACK
408
+
409
+# JScript function "_decode" - from DeanEdwards pack.js
410
+($_JSdecode) = <<'END_JSCRIPT_DECODE';
411
+  /* code-snippet inserted into the unpacker to speed up decoding */
412
+  function() {
413
+    /* does the browser support String.replace where the */
414
+    /*  replacement value is a function? */
415
+    if (!''.replace(/^/, String)) {
416
+      /* decode all the values we need */
417
+          while ($count--) $decode[$encode($count)] = $keywords[$count] || $encode($count);
418
+          /* global replacement function */
419
+          $keywords = [function($encoded){return $decode[$encoded]}];
420
+          /* generic match */
421
+          $encode = function(){return'\\w+'};
422
+          /* reset the loop counter -  we are now doing a global replace */
423
+          $count = 1;
424
+      }
425
+  };
426
+END_JSCRIPT_DECODE
427
+
428
+# JScript versions of encoders
429
+($_JSencode10) = <<'END_JSCRIPT_ENCODE10';
430
+  /* zero encoding */
431
+  /* characters: 0123456789 */
432
+  function($charCode) {
433
+    return $charCode;
434
+  };
435
+END_JSCRIPT_ENCODE10
436
+
437
+($_JSencode36) = <<'END_JSCRIPT_ENCODE36';
438
+  /* inherent base36 support */
439
+  /* characters: 0123456789abcdefghijklmnopqrstuvwxyz */
440
+  function($charCode) {
441
+    return $charCode.toString(36);
442
+  };
443
+END_JSCRIPT_ENCODE36
444
+
445
+($_JSencode62) = <<'END_JSCRIPT_ENCODE62';
446
+  /* hitch a ride on base36 and add the upper case alpha characters */
447
+  /* characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ */
448
+  function($charCode) {
449
+    return ($charCode < _encoding ? '' : arguments.callee(parseInt($charCode / _encoding))) +
450
+    (($charCode = $charCode % _encoding) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36));
451
+   };
452
+END_JSCRIPT_ENCODE62
453
+
454
+($_JSencode95) = <<'END_JSCRIPT_ENCODE95';
455
+ /* use high-ascii values */
456
+ /* characters: 、�ウЖ��⑭�渦慨偽係杭纂従神疎団兎波品北洋椀冫嘖孛忤掣桀毳烙痰邃繙艾蜉謖邇關髓齡��巐鄕� */
457
+ function($charCode) {
458
+   return ($charCode < _encoding ? '' : arguments.callee($charCode / _encoding)) +
459
+     String.fromCharCode($charCode % _encoding + 161);
460
+ };
461
+END_JSCRIPT_ENCODE95
462
+
463
+###########
464
+# END     #
465
+###########
466
+1; # Pack #
467
+###########

+ 207
- 0
build/packer/ParseMaster.pm Näytä tiedosto

@@ -0,0 +1,207 @@
1
+#ParseMaster (July 25 2005)
2
+#  Based on "ParseMaster.js" by Dean Edwards <http://dean.edwards.name/>
3
+#  Ported to Perl by Rob Seiler, ELR Software Pty Ltd <http://www.elr.com.au>
4
+#  Copyright 2005. License <http://creativecommons.org/licenses/LGPL/2.1/>
5
+
6
+package ParseMaster;
7
+use strict;
8
+use Data::Dumper;
9
+
10
+# Package wide variable declarations
11
+use vars qw/$VERSION
12
+            @_X_escaped @_X_patterns
13
+           /;
14
+
15
+$VERSION    = '017';
16
+
17
+# constants
18
+my $X_EXPRESSION  = 0;
19
+my $X_REPLACEMENT = 1;
20
+my $X_LENGTH      = 2;
21
+
22
+# re's used to determine nesting levels
23
+my $X_GROUPS      = qr/\(/o;                # NB: Requires g modifier!
24
+my $X_SUB_REPLACE = qr/\$\d/o;
25
+my $X_INDEXED     = qr/^\$\d+$/o;
26
+my $XX_ESCAPE     = qr/\\./o;               # NB: Requires g modifier!
27
+my $XX_DELETED    = qr/\001[^\001]*\001/o;  # NB: Requires g modifier!
28
+my $DIGIT         = qr/[^\D]/o;             # Yep - this is a digit - contains no non-digits
29
+
30
+# Constructor
31
+sub new {
32
+  my $class = shift;
33
+  my $self  = {};
34
+  @_X_escaped  = ();  # Re-initialize global for each instance
35
+  @_X_patterns = ();  # Re-initialize global for each instance
36
+  # Instance variables - access by similarly named set/get functions
37
+  $self->{_ignoreCase_} = 0;
38
+  $self->{_escapeChar_} = '';
39
+  bless ($self, $class);
40
+  return $self;
41
+}
42
+
43
+sub ignoreCase {
44
+  my ($self, $value) = @_;
45
+  if (defined($value)) {
46
+    $self->{_ignoreCase_} = $value;
47
+  }
48
+  return $self->{_ignoreCase_};
49
+}
50
+
51
+sub escapeChar{
52
+  my ($self, $value) = @_;
53
+  if (defined($value)) {
54
+    $self->{_escapeChar_} = $value;
55
+  }
56
+  return $self->{_escapeChar_};
57
+}
58
+
59
+#######################
60
+# Public Parsemaster functions
61
+
62
+my $X_DELETE = sub(@$) {
63
+  my $X_offset = pop;
64
+  my @X_match = @_;
65
+  return (chr(001) . $X_match[$X_offset] . chr(001));
66
+}; # NB semicolon required for closure!
67
+
68
+# create and add a new pattern to the patterns collection
69
+sub add {
70
+  my ($self, $expression, $X_replacement) = @_;
71
+  if (!$X_replacement) {$X_replacement = $X_DELETE};
72
+
73
+  # count the number of sub-expressions
74
+  my $temp = &_X_internalEscape($expression);
75
+  my $length  = 1; # Always at least one because each pattern is itself a sub-expression
76
+     $length += $temp =~ s/$X_GROUPS//g; # One way to count the left capturing parentheses in the regexp string
77
+
78
+  # does the pattern deal with sub-expressions?
79
+  if ((ref($X_replacement) ne "CODE") && ($X_replacement =~ m/$X_SUB_REPLACE/)) {
80
+    if ($X_replacement =~ m/$X_INDEXED/) { # a simple lookup? (eg "$2")
81
+      # store the index (used for fast retrieval of matched strings)
82
+      $X_replacement = substr($X_replacement,1) - 1;
83
+    }
84
+    else { # a complicated lookup (eg "Hello $2 $1")
85
+      my $i = $length;
86
+      while ($i) { # Had difficulty getting Perl to do Dean's splitting and joining of strings containing $'s
87
+        my $str = '$a[$o+' . ($i-1) . ']'; # eg $a[$o+1]
88
+        $X_replacement =~ s/\$$i/$str/;      # eg $2 $3 -> $a[$o+1] $a[$o+2]
89
+        $i--;
90
+      }
91
+      # build a function to do the lookup - returns interpolated string of array lookups
92
+      $X_replacement = eval('sub {my $o=pop; my @a=@_; return "' . $X_replacement . '"};');
93
+    }
94
+  }
95
+  else {}
96
+  # pass the modified arguments
97
+  &_X_add($expression || q/^$/, $X_replacement, $length);
98
+}
99
+
100
+# execute the global replacement
101
+sub exec {
102
+#print Dumper(@_X_patterns);
103
+  my ($self, $X_string) = @_;
104
+  my $escChar    = $self->escapeChar();
105
+  my $ignoreCase = $self->ignoreCase();
106
+  my ($regexp,$captures) = &_getPatterns();  # Concatenated and parenthesized regexp eg '(regex1)|(regex2)|(regex3)' etc
107
+  $X_string = &_X_escape($X_string, $escChar);
108
+  if ($ignoreCase) {$X_string =~ s/$regexp/{&_X_replacement(&_matchVars($captures,\$X_string))}/gie} # Pass $X_String as a
109
+    else           {$X_string =~ s/$regexp/{&_X_replacement(&_matchVars($captures,\$X_string))}/ge}  # reference for speed
110
+
111
+  $X_string = &_X_unescape($X_string, $escChar);
112
+  $X_string =~ s/$XX_DELETED//g;
113
+  return $X_string;
114
+}
115
+
116
+sub _X_add {
117
+  push (@_X_patterns, [@_]); # Save each argument set as is into an array of arrays
118
+}
119
+
120
+# this is the global replace function (it's quite complicated)
121
+sub _X_replacement {
122
+  my (@arguments) = @_;
123
+#print Dumper (@arguments);
124
+  if ($arguments[0] le '') {return ''}
125
+  # Dereference last index (source String) here - faster than in _matchVars (maybe not needed at all?)
126
+  $arguments[$#arguments] = ${$arguments[$#arguments]};
127
+  my $i = 1;
128
+  # loop through the patterns
129
+  for (my $j=0; $j<scalar(@_X_patterns); $j++) { # Loop through global all @_X_patterns
130
+    my @X_pattern = @{$_X_patterns[$j]};
131
+    # do we have a result? NB: "if ($arguments[$i])" as in Dean's Javascript is false for the value 0!!!
132
+    if ((defined $arguments[$i]) && ($arguments[$i] gt '')) {
133
+      my $X_replacement = $X_pattern[$X_REPLACEMENT];
134
+      # switch on type of $replacement
135
+      if (ref($X_replacement) eq "CODE") {     # function
136
+        return &$X_replacement(@arguments,$i);
137
+      }
138
+      elsif ($X_replacement =~ m/$DIGIT/) {    # number (contains no non-digits)
139
+        return $arguments[$X_replacement + $i];
140
+      }
141
+      else { # default
142
+        return $X_replacement;                 # default
143
+      }
144
+    } # skip over references to sub-expressions
145
+    else {$i += $X_pattern[$X_LENGTH]}
146
+  }
147
+}
148
+
149
+#######################
150
+# Private functions
151
+#######################
152
+
153
+# encode escaped characters
154
+sub _X_escape {
155
+  my ($X_string, $X_escapeChar) = @_;
156
+  if ($X_escapeChar) {
157
+    my $re = '\\'.$X_escapeChar.'(.)';
158
+    $X_string =~ s/$re/{push(@_X_escaped,$1); $X_escapeChar}/ge;
159
+  }
160
+  return $X_string;
161
+}
162
+
163
+# decode escaped characters
164
+sub _X_unescape {
165
+  my ($X_string, $X_escapeChar) = @_;
166
+  if ($X_escapeChar) { # We'll only do this if there is an $X_escapeChar!
167
+    my $re = '\\'.$X_escapeChar;
168
+    $X_string =~ s/$re/{$X_escapeChar . (shift(@_X_escaped))}/ge; # Don't use Dean Edwards as below 'or' here - because zero will return ''!
169
+  # $X_string =~ s/$re/{$X_escapeChar . (shift(@_X_escaped) || '')}/ge;
170
+  }
171
+  return $X_string;
172
+}
173
+
174
+sub _X_internalEscape {
175
+  my ($string) = shift;
176
+  $string =~ s/$XX_ESCAPE//g;
177
+  return $string;
178
+}
179
+
180
+# Builds an array of match variables to (approximately) emulate that available in Javascript String.replace()
181
+sub _matchVars {
182
+  my ($m,$sref) = @_;
183
+  my @args = (1..$m);                # establish the number potential memory variables
184
+  my @mv = map {eval("\$$_")} @args; # matchvarv[1..m] = the memory variables $1 .. $m
185
+  unshift (@mv, $&);                 # matchvar[0]     = the substring that matched
186
+  push    (@mv, length($`));         # matchvar[m+1]   =  offset within the source string where the match occurred (= length of prematch string)
187
+  push    (@mv, $sref);              # matchvar[m+2]   = reference to full source string (dereference in caller if/when needed)
188
+#print Dumper (@mv);
189
+  return @mv;
190
+}
191
+
192
+sub _getPatterns {
193
+  my @Patterns = ();
194
+  my $lcp = 0;
195
+  for (my $i=0; $i<scalar(@_X_patterns); $i++) {       # Loop through global all @_patterns
196
+    push (@Patterns, $_X_patterns[$i][$X_EXPRESSION]); # accumulate the expressions
197
+    $lcp += $_X_patterns[$i][$X_LENGTH];               # sum the left capturing parenthesis counts
198
+  }
199
+  my $str = "(" . join(')|(',@Patterns). ")";          # enclose each pattern in () separated by "|"
200
+  return ($str, $lcp);
201
+}
202
+
203
+##################
204
+# END            #
205
+##################
206
+1; # ParseMaster #
207
+##################

+ 163
- 0
build/packer/jsPacker.pl Näytä tiedosto

@@ -0,0 +1,163 @@
1
+#!perl
2
+#jsPacker (July 2005)
3
+#
4
+use strict;
5
+use Pack;
6
+use vars qw($PROGNAME $VERSION
7
+            $opt_h $opt_q $opt_v $opt_i $opt_o $opt_e $opt_f $opt_s);
8
+use Getopt::Std;
9
+
10
+$PROGNAME    = $0;
11
+$VERSION     = '1.00b';
12
+
13
+my $Description = 'A JavaScript Compressor/Obfuscator';
14
+my $Version    = "v$VERSION\[p$Pack::VERSION-pm$Pack::PM_VERSION\]";
15
+
16
+# "English" versions of settings
17
+my %ENCODINGS = (0=>'None', 10=>'Decimal', 36=>'Normal', 62=>'Normal', 95=>'High-ascii');
18
+my %SETTINGS  = (0=>'No', 1=>'Yes');
19
+
20
+exit(0) if &main();
21
+exit(1);
22
+
23
+################
24
+# Sub-routines #
25
+################
26
+# Main program
27
+sub main {
28
+  # Get command line options
29
+  &getopts('hqvfsi:o:e:');
30
+  $opt_h ||= 0;   # $opt_h shows usage and exits
31
+  $opt_q ||= 0;   # $opt_q sets quiet mode (no stdout output)
32
+  $opt_v ||= 0;   # $opt_v shows version and exits
33
+  $opt_i ||= '';  # $opt_i is input file. Required!
34
+  $opt_o ||= '';  # $opt_o is output file. If not set, use standard output
35
+  $opt_e ||= 0;   # $opt_e encoding level (0,10,36,62,95)
36
+  $opt_f ||= 0;   # $opt_f use fast decoding
37
+  $opt_s ||= 0;   # $opt_x use special characters
38
+
39
+  # Display help or version if requested
40
+  if ($opt_h) {&usage("help")}
41
+  if ($opt_v) {&usage("version")}
42
+
43
+  # Constrain encoding level, fastdecoding and specialcharacters to allowed limits
44
+  $opt_e = ($opt_e > 0) ? ($opt_e > 10) ? ($opt_e > 36) ? ($opt_e > 62) ? 95 : 62 : 36 : 10 : 0;
45
+  $opt_f = ($opt_f) ? 1 : 0;
46
+  $opt_s = ($opt_s) ? 1 : 0;
47
+
48
+  # Do the job if an input file is specified
49
+  if ($opt_i) {
50
+    # Read the source script
51
+    my $script = &readInputFile($opt_i);
52
+    # Pack the source script
53
+    my $packedscript = &Pack::pack($script,$opt_e, $opt_f, $opt_s);
54
+    # Show what happened (if not in quiet mode)
55
+    if (!$opt_q) {showJobDetails($opt_i, $opt_o, $opt_e, $opt_f,$opt_s,\$script,\$packedscript)}
56
+    # Output the packed script
57
+    if ($opt_o) {&writeOutputFile($opt_o,\$packedscript)} # to output file if specifed
58
+      else {print "$packedscript"}                        # otherwise to STDOUT
59
+  }
60
+  else { # If no input file is specified, display help
61
+    &usage();
62
+  }
63
+  return(1);
64
+}
65
+
66
+######################
67
+sub showJobDetails { #
68
+######################
69
+# Show details of input/output files, settings and compression ratio
70
+  my ($inputfile, $outputfile,
71
+      $encoding, $fastdecode, $specialchars,
72
+      $instringref, $outstringref) = @_;
73
+  print "$PROGNAME $Version\n";
74
+  print "\tSource file : ";
75
+  print "\"$inputfile\"\n";
76
+  print (($outputfile) ? ("\tOutput file : \"$outputfile\"\n") : ''); # Print only if output is going to a file
77
+  print "\tSettings    : encoding=$ENCODINGS{$encoding} fastdecode=$SETTINGS{$fastdecode} specialchars=$SETTINGS{$specialchars}\n";
78
+  print "\tCompression : " . &compressionRatio($instringref, $outstringref). "\n\n";
79
+
80
+}
81
+
82
+#####################
83
+sub readInputFile { #
84
+#####################
85
+# Read content (source script) from input file
86
+  my $filename = shift;
87
+  open(FH, $filename) || die "Error!!! Problem opening input file \"$filename\"!\n";
88
+  my @content = <FH>;
89
+  close(FH);
90
+  return join('',@content);
91
+}
92
+
93
+#######################
94
+sub writeOutputFile { #
95
+#######################
96
+# Write content (packed script) to output file
97
+  my ($filename,$refcontent) = @_;
98
+  open(FH, ">$filename") || die "Error!!! Problem opening output file \"$filename\"\n";
99
+  print(FH $$refcontent);
100
+  close(FH);
101
+}
102
+
103
+########################
104
+sub compressionRatio { #
105
+########################
106
+# Calculate the ratio of output string to input string
107
+  my ($sref1,$sref2) = @_;
108
+  my $ratio = (length($$sref2) / (length($$sref1)||1));
109
+  $ratio = sprintf "%.2f", $ratio;
110
+  return $ratio;
111
+}
112
+
113
+#############
114
+sub usage { #
115
+#############
116
+# Inform user about usage, version and exit
117
+  my $showusage = 0;
118
+  my $showversion = 0;
119
+  my $params = shift;
120
+  if (defined $params) {
121
+    if ($params eq "help") {$showusage = 1;}
122
+      elsif ($params eq "version") {$showversion = 1;}
123
+    else {$showusage = 1;}
124
+  }
125
+  else {$showversion = 1;}
126
+  if ($showversion) {
127
+    print<<EOT;
128
+
129
+$PROGNAME $Version
130
+  $Description
131
+\tBased on "Packer.js" by Dean Edwards <http://dean.edwards.name/>
132
+\tPorted to Perl by Rob Seiler, ELR Software Pty Ltd <http://www.elr.com.au>
133
+\tCopyright 2005. License <http://creativecommons.org/licenses/LGPL/2.1/>
134
+  Use "$PROGNAME -h" for options
135
+EOT
136
+  exit(1);
137
+  }
138
+  if ($showusage) {
139
+    print<<EOT;
140
+
141
+$PROGNAME $Version
142
+  $Description
143
+  Usage:
144
+\t$PROGNAME -i inputfile [-o outputfile] [-eX] [-f] [-s] [-qvh]\n
145
+\t-i  <inputfile>  (eg -i myscript.js)
146
+\t-o  <outputfile> (eg -o myscript-p.js)
147
+\t-eN <encoding>   [0=None 10=Numeric 62=Normal(alphanumeric) 95=High-ascii]
148
+\t-f  <fast decode>
149
+\t-s  <special characters>
150
+\t-q  quiet mode
151
+\t-v  version
152
+\t-h  help
153
+
154
+  Examples:
155
+\t$PROGNAME -i myscript.js
156
+\t$PROGNAME -i myscript.js -o packed.js
157
+\t$PROGNAME -i myscript.js -o packed.js -e10 -f -s
158
+\t$PROGNAME -i myscript.js -e95 -fsq > packed.js
159
+
160
+EOT
161
+  exit(1);
162
+  }
163
+}

+ 65
- 0
example-proxy.html Näytä tiedosto

@@ -0,0 +1,65 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+<html>
4
+<head>
5
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+<title>jFeed - jQuery feed parser plugin - example</title>
7
+<style type="text/css">
8
+    h3 { margin-bottom: 5px; }
9
+    div.updated { color: #999; margin-bottom: 5px; font-size: 0.8em; }
10
+</style>
11
+<script type="text/javascript" src="jquery/jquery.js"></script>
12
+<script type="text/javascript" src="build/dist/jquery.jfeed.pack.js"></script>
13
+
14
+<script type="text/javascript">
15
+
16
+jQuery(function() {
17
+
18
+    jQuery.getFeed({
19
+        url: 'proxy.php?url=http://www.hovinne.com/feed/',
20
+        success: function(feed) {
21
+        
22
+            jQuery('#result').append('<h2>'
23
+            + '<a href="'
24
+            + feed.link
25
+            + '">'
26
+            + feed.title
27
+            + '</a>'
28
+            + '</h2>');
29
+            
30
+            var html = '';
31
+            
32
+            for(var i = 0; i < feed.items.length && i < 5; i++) {
33
+            
34
+                var item = feed.items[i];
35
+                
36
+                html += '<h3>'
37
+                + '<a href="'
38
+                + item.link
39
+                + '">'
40
+                + item.title
41
+                + '</a>'
42
+                + '</h3>';
43
+                
44
+                html += '<div class="updated">'
45
+                + item.updated
46
+                + '</div>';
47
+                
48
+                html += '<div>'
49
+                + item.description
50
+                + '</div>';
51
+            }
52
+            
53
+            jQuery('#result').append(html);
54
+        }    
55
+    });
56
+});
57
+
58
+</script>
59
+
60
+</head>
61
+<body>
62
+<h1>jFeed - jQuery feed parser plugin - example</h1>
63
+<div id="result" />
64
+</body>
65
+</html>

+ 65
- 0
example.html Näytä tiedosto

@@ -0,0 +1,65 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+<html>
4
+<head>
5
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+<title>jFeed - jQuery feed parser plugin - example</title>
7
+<style type="text/css">
8
+    h3 { margin-bottom: 5px; }
9
+    div.updated { color: #999; margin-bottom: 5px; font-size: 0.8em; }
10
+</style>
11
+<script type="text/javascript" src="jquery/jquery.js"></script>
12
+<script type="text/javascript" src="build/dist/jquery.jfeed.pack.js"></script>
13
+
14
+<script type="text/javascript">
15
+
16
+jQuery(function() {
17
+
18
+    jQuery.getFeed({
19
+        url: 'xml/rss-20.xml',
20
+        success: function(feed) {
21
+        
22
+            jQuery('#result').append('<h2>'
23
+            + '<a href="'
24
+            + feed.link
25
+            + '">'
26
+            + feed.title
27
+            + '</a>'
28
+            + '</h2>');
29
+            
30
+            var html = '';
31
+            
32
+            for(var i = 0; i < feed.items.length && i < 5; i++) {
33
+            
34
+                var item = feed.items[i];
35
+                
36
+                html += '<h3>'
37
+                + '<a href="'
38
+                + item.link
39
+                + '">'
40
+                + item.title
41
+                + '</a>'
42
+                + '</h3>';
43
+                
44
+                html += '<div class="updated">'
45
+                + item.updated
46
+                + '</div>';
47
+                
48
+                html += '<div>'
49
+                + item.description
50
+                + '</div>';
51
+            }
52
+            
53
+            jQuery('#result').append(html);
54
+        }    
55
+    });
56
+});
57
+
58
+</script>
59
+
60
+</head>
61
+<body>
62
+<h1>jFeed - jQuery feed parser plugin - example</h1>
63
+<div id="result" />
64
+</body>
65
+</html>

+ 11
- 0
jquery/jquery.js
File diff suppressed because it is too large
Näytä tiedosto


+ 12
- 0
proxy.php Näytä tiedosto

@@ -0,0 +1,12 @@
1
+<?php
2
+header('Content-type: application/xml');
3
+$handle = fopen($_REQUEST['url'], "r");
4
+
5
+if ($handle) {
6
+    while (!feof($handle)) {
7
+        $buffer = fgets($handle, 4096);
8
+        echo $buffer;
9
+    }
10
+    fclose($handle);
11
+}
12
+?>

+ 36
- 0
src/jatom.js Näytä tiedosto

@@ -0,0 +1,36 @@
1
+function JAtom(xml) {
2
+    this._parse(xml);
3
+};
4
+
5
+JAtom.prototype = {
6
+    
7
+    _parse: function(xml) {
8
+    
9
+        var channel = jQuery('feed', xml).eq(0);
10
+
11
+        this.version = '1.0';
12
+        this.title = jQuery(channel).find('title:first').text();
13
+        this.link = jQuery(channel).find('link:first').attr('href');
14
+        this.description = jQuery(channel).find('subtitle:first').text();
15
+        this.language = jQuery(channel).attr('xml:lang');
16
+        this.updated = jQuery(channel).find('updated:first').text();
17
+        
18
+        this.items = new Array();
19
+        
20
+        var feed = this;
21
+        
22
+        jQuery('entry', xml).each( function() {
23
+        
24
+            var item = new JFeedItem();
25
+            
26
+            item.title = jQuery(this).find('title').eq(0).text();
27
+            item.link = jQuery(this).find('link').eq(0).attr('href');
28
+            item.description = jQuery(this).find('content').eq(0).text();
29
+            item.updated = jQuery(this).find('updated').eq(0).text();
30
+            item.id = jQuery(this).find('id').eq(0).text();
31
+            
32
+            feed.items.push(item);
33
+        });
34
+    }
35
+};
36
+

+ 59
- 0
src/jfeed.js Näytä tiedosto

@@ -0,0 +1,59 @@
1
+/* jFeed : jQuery feed parser plugin
2
+ * Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/
3
+ * Dual licensed under the MIT (MIT-license.txt)
4
+ * and GPL (GPL-license.txt) licenses.
5
+ */
6
+
7
+jQuery.getFeed = function(options) {
8
+
9
+    options = jQuery.extend({
10
+    
11
+        url: null,
12
+        data: null,
13
+        success: null
14
+        
15
+    }, options);
16
+
17
+    if(options.url) {
18
+
19
+        $.ajax({
20
+            type: 'GET',
21
+            url: options.url,
22
+            data: options.data,
23
+            dataType: 'xml',
24
+            success: function(xml) {
25
+                var feed = new JFeed(xml);
26
+                if(jQuery.isFunction(options.success)) options.success(feed);
27
+            }
28
+        });
29
+    }
30
+};
31
+
32
+function JFeed(xml) {
33
+    if(xml) this.parse(xml);
34
+};
35
+
36
+JFeed.prototype = {
37
+
38
+    type: '',
39
+    version: '',
40
+    title: '',
41
+    link: '',
42
+    description: '',
43
+    parse: function(xml) {
44
+        
45
+        if(jQuery('channel', xml).length == 1) {
46
+        
47
+            this.type = 'rss';
48
+            var feedClass = new JRss(xml);
49
+
50
+        } else if(jQuery('feed', xml).length == 1) {
51
+        
52
+            this.type = 'atom';
53
+            var feedClass = new JAtom(xml);
54
+        }
55
+        
56
+        if(feedClass) jQuery.extend(this, feedClass);
57
+    }
58
+};
59
+

+ 11
- 0
src/jfeeditem.js Näytä tiedosto

@@ -0,0 +1,11 @@
1
+function JFeedItem() {};
2
+
3
+JFeedItem.prototype = {
4
+
5
+    title: '',
6
+    link: '',
7
+    description: '',
8
+    updated: '',
9
+    id: ''
10
+};
11
+

+ 38
- 0
src/jrss.js Näytä tiedosto

@@ -0,0 +1,38 @@
1
+function JRss(xml) {
2
+    this._parse(xml);
3
+};
4
+
5
+JRss.prototype  = {
6
+    
7
+    _parse: function(xml) {
8
+    
9
+        if(jQuery('rss', xml).length == 0) this.version = '1.0';
10
+        else this.version = jQuery('rss', xml).eq(0).attr('version');
11
+
12
+        var channel = jQuery('channel', xml).eq(0);
13
+    
14
+        this.title = jQuery(channel).find('title:first').text();
15
+        this.link = jQuery(channel).find('link:first').text();
16
+        this.description = jQuery(channel).find('description:first').text();
17
+        this.language = jQuery(channel).find('language:first').text();
18
+        this.updated = jQuery(channel).find('lastBuildDate:first').text();
19
+    
20
+        this.items = new Array();
21
+        
22
+        var feed = this;
23
+        
24
+        jQuery('item', xml).each( function() {
25
+        
26
+            var item = new JFeedItem();
27
+            
28
+            item.title = jQuery(this).find('title').eq(0).text();
29
+            item.link = jQuery(this).find('link').eq(0).text();
30
+            item.description = jQuery(this).find('description').eq(0).text();
31
+            item.updated = jQuery(this).find('pubDate').eq(0).text();
32
+            item.id = jQuery(this).find('guid').eq(0).text();
33
+            
34
+            feed.items.push(item);
35
+        });
36
+    }
37
+};
38
+

+ 54
- 0
test-dist-packed.html Näytä tiedosto

@@ -0,0 +1,54 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+<html>
4
+<head>
5
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+<title>jFeed - jQuery feed parser plugin - test</title>
7
+<script type="text/javascript" src="jquery/jquery.js"></script>
8
+<script type="text/javascript" src="build/dist/jquery.jfeed.pack.js"></script>
9
+
10
+<script type="text/javascript">
11
+
12
+jQuery(function() {
13
+
14
+    var feedsUrls = ['xml/rss-091.xml',
15
+                     'xml/rss-092.xml',
16
+                     'xml/rss-10.xml',
17
+                     'xml/rss-20.xml',
18
+                     'xml/atom.xml'];
19
+                 
20
+    for(var i = 0; i < feedsUrls.length; i++) {
21
+
22
+        jQuery.getFeed({url: feedsUrls[i], success: function(feed) {
23
+        
24
+            console.log('feed type: ' + feed.type);
25
+            console.log('feed version: ' + feed.version);
26
+            console.log('feed title: ' + feed.title);
27
+            console.log('feed link: ' + feed.link);
28
+            console.log('feed description: ' + feed.description);
29
+            console.log('feed language: ' + feed.language);
30
+            console.log('feed updated: ' + feed.updated);
31
+            console.log('feed items: ' + feed.items.length);
32
+            
33
+            for(var j = 0; j < feed.items.length; j++) {
34
+            
35
+                console.log('item ' + j + ' title: ' + feed.items[j].title);
36
+                console.log('item ' + j + ' link: ' + feed.items[j].link);
37
+                console.log('item ' + j + ' description: '
38
+                + feed.items[j].description);
39
+                console.log('item ' + j + ' updated: ' + feed.items[j].updated);
40
+                console.log('item ' + j + ' id: ' + feed.items[j].id);
41
+            }
42
+        }
43
+        });
44
+    }
45
+});
46
+
47
+</script>
48
+
49
+</head>
50
+<body>
51
+<h1>jFeed - jQuery feed parser plugin - test</h1>
52
+<p>Please open Firefox + Firebug console</p>
53
+</body>
54
+</html>

+ 54
- 0
test-dist.html Näytä tiedosto

@@ -0,0 +1,54 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+<html>
4
+<head>
5
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+<title>jFeed - jQuery feed parser plugin - test</title>
7
+<script type="text/javascript" src="jquery/jquery.js"></script>
8
+<script type="text/javascript" src="build/dist/jquery.jfeed.js"></script>
9
+
10
+<script type="text/javascript">
11
+
12
+jQuery(function() {
13
+
14
+    var feedsUrls = ['xml/rss-091.xml',
15
+                     'xml/rss-092.xml',
16
+                     'xml/rss-10.xml',
17
+                     'xml/rss-20.xml',
18
+                     'xml/atom.xml'];
19
+                 
20
+    for(var i = 0; i < feedsUrls.length; i++) {
21
+
22
+        jQuery.getFeed({url: feedsUrls[i], success: function(feed) {
23
+        
24
+            console.log('feed type: ' + feed.type);
25
+            console.log('feed version: ' + feed.version);
26
+            console.log('feed title: ' + feed.title);
27
+            console.log('feed link: ' + feed.link);
28
+            console.log('feed description: ' + feed.description);
29
+            console.log('feed language: ' + feed.language);
30
+            console.log('feed updated: ' + feed.updated);
31
+            console.log('feed items: ' + feed.items.length);
32
+            
33
+            for(var j = 0; j < feed.items.length; j++) {
34
+            
35
+                console.log('item ' + j + ' title: ' + feed.items[j].title);
36
+                console.log('item ' + j + ' link: ' + feed.items[j].link);
37
+                console.log('item ' + j + ' description: '
38
+                + feed.items[j].description);
39
+                console.log('item ' + j + ' updated: ' + feed.items[j].updated);
40
+                console.log('item ' + j + ' id: ' + feed.items[j].id);
41
+            }
42
+        }
43
+        });
44
+    }
45
+});
46
+
47
+</script>
48
+
49
+</head>
50
+<body>
51
+<h1>jFeed - jQuery feed parser plugin - test</h1>
52
+<p>Please open Firefox + Firebug console</p>
53
+</body>
54
+</html>

+ 64
- 0
test-src.html Näytä tiedosto

@@ -0,0 +1,64 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+<html>
4
+<head>
5
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+<title>jFeed - jQuery feed parser plugin - test</title>
7
+<script type="text/javascript" src="jquery/jquery.js"></script>
8
+<script type="text/javascript" src="src/jfeed.js"></script>
9
+<script type="text/javascript" src="src/jfeeditem.js"></script>
10
+<script type="text/javascript" src="src/jatom.js"></script>
11
+<script type="text/javascript" src="src/jrss.js"></script>
12
+
13
+<script type="text/javascript">
14
+
15
+jQuery(function() {
16
+
17
+    var feedsUrls = ['xml/rss-091.xml',
18
+                     'xml/rss-092.xml',
19
+                     'xml/rss-10.xml',
20
+                     'xml/rss-20.xml',
21
+                     'xml/atom.xml'];
22
+  
23
+    jQuery().ajaxError(function(request, settings, ex) {
24
+        console.log('Request error');
25
+        for(var i in ex) {
26
+            console.log(i + ': ' + ex[i]);
27
+        }
28
+    });
29
+                 
30
+    for(var i = 0; i < feedsUrls.length; i++) {
31
+
32
+        jQuery.getFeed({url: feedsUrls[i], success: function(feed) {
33
+        
34
+            console.log('feed type: ' + feed.type);
35
+            console.log('feed version: ' + feed.version);
36
+            console.log('feed title: ' + feed.title);
37
+            console.log('feed link: ' + feed.link);
38
+            console.log('feed description: ' + feed.description);
39
+            console.log('feed language: ' + feed.language);
40
+            console.log('feed updated: ' + feed.updated);
41
+            console.log('feed items: ' + feed.items.length);
42
+            
43
+            for(var j = 0; j < feed.items.length; j++) {
44
+            
45
+                console.log('item ' + j + ' title: ' + feed.items[j].title);
46
+                console.log('item ' + j + ' link: ' + feed.items[j].link);
47
+                console.log('item ' + j + ' description: '
48
+                + feed.items[j].description);
49
+                console.log('item ' + j + ' updated: ' + feed.items[j].updated);
50
+                console.log('item ' + j + ' id: ' + feed.items[j].id);
51
+            }
52
+        }
53
+        });
54
+    }
55
+});
56
+
57
+</script>
58
+
59
+</head>
60
+<body>
61
+<h1>jFeed - jQuery feed parser plugin - test</h1>
62
+<p>Please open Firefox + Firebug console</p>
63
+</body>
64
+</html>

+ 157
- 0
xml/atom.xml Näytä tiedosto

@@ -0,0 +1,157 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+<?xml-stylesheet href="http://www.atomenabled.org/css/atom.css" type="text/css"?>
3
+
4
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
5
+<title type="html">AtomEnabled.org</title>
6
+<subtitle type="html">Your one stop shop for all Atom API and syndication information.</subtitle>
7
+
8
+<link href="http://www.atomenabled.org/atom.xml" rel="self"/>
9
+<icon>http://www.atomenabled.org/favicon.ico</icon>
10
+<link href="http://www.atomenabled.org" rel="alternate" title="AtomEnabled.org" type="text/html"/>
11
+<id>tag:blogger.com,1999:blog-6356614</id>
12
+<updated>2006-09-23T19:44:56Z</updated>
13
+
14
+<generator uri="http://www.blogger.com/" version="6.72">Blogger</generator>
15
+<div class="info" xmlns="http://www.w3.org/1999/xhtml">This is an Atom formatted XML site feed. It is intended to be viewed in a Newsreader or syndicated to another site. Please visit the <a href="http://help.blogger.com/bin/answer.py?answer=697">Blogger Help</a> for more info.</div>
16
+<convertLineBreaks xmlns="http://www.blogger.com/atom/ns#">false</convertLineBreaks>
17
+<entry xmlns="http://www.w3.org/2005/Atom">
18
+<author>
19
+<name>Sam Ruby</name>
20
+</author>
21
+<published>2006-09-23T12:42:00-07:00</published>
22
+<updated>2006-09-23T19:44:56Z</updated>
23
+
24
+<link href="http://www.atomenabled.org/2006/09/moving-toward-atom.php" rel="alternate" title="Moving Toward Atom" type="text/html"/>
25
+<id>tag:blogger.com,1999:blog-6356614.post-115904069601028798</id>
26
+<title type="html">Moving Toward Atom</title>
27
+<content type="xhtml" xml:base="http://www.atomenabled.org" xml:space="preserve">
28
+<div xmlns="http://www.w3.org/1999/xhtml">The US Intelligence Community Metadata Working Group has issued a <a href="https://dnidata.org/education/xnotes/RSS_and_Atom_Considerations.xml">recommendation</a> that the Intelligence Community, over time, move toward adoption of Atom Syndication Format as the Community’s standard XML-based language for syndication feeds.</div>
29
+</content>
30
+<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
31
+</entry>
32
+<entry xmlns="http://www.w3.org/2005/Atom">
33
+<author>
34
+
35
+<name>Sam Ruby</name>
36
+</author>
37
+<published>2006-08-04T13:50:00-07:00</published>
38
+<updated>2006-08-04T20:53:17Z</updated>
39
+<link href="http://www.atomenabled.org/2006/08/enabling-atom-10-on-wordpress.php" rel="alternate" title="Enabling Atom 1.0 on Wordpress" type="text/html"/>
40
+<id>tag:blogger.com,1999:blog-6356614.post-115472479762549620</id>
41
+<title type="html">Enabling Atom 1.0 on Wordpress</title>
42
+<content type="xhtml" xml:base="http://www.atomenabled.org" xml:space="preserve">
43
+<div xmlns="http://www.w3.org/1999/xhtml">James Snell has <a href="http://www.snellspace.com/wp/?p=404">posted instructions</a> on how you can produce valid Atom 1.0 feeds with WordPress.</div>
44
+
45
+</content>
46
+<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
47
+</entry>
48
+<entry xmlns="http://www.w3.org/2005/Atom">
49
+<author>
50
+<name>Sam Ruby</name>
51
+</author>
52
+<published>2006-07-29T21:34:00-07:00</published>
53
+<updated>2006-07-30T04:38:20Z</updated>
54
+<link href="http://www.atomenabled.org/2006/07/tri-xml-2006-presentation.php" rel="alternate" title="Tri-XML 2006 presentation" type="text/html"/>
55
+<id>tag:blogger.com,1999:blog-6356614.post-115423429120046231</id>
56
+<title type="html">Tri-XML 2006 presentation</title>
57
+
58
+<content type="xhtml" xml:base="http://www.atomenabled.org" xml:space="preserve">
59
+<div xmlns="http://www.w3.org/1999/xhtml">
60
+<a href="http://rollerweblogger.org/page/roller">Dave Johnson</a> gave an <a href="http://rollerweblogger.org/page/roller?entry=tri_xml_2006_presentation">excellent talk</a> on the Atom feed format and Atom Publishing Protocol.  Here's the abstract:
61
+<blockquote>
62
+<span style="font-weight: bold;">Beyond blogging: Atom format and protocol</span>. Like XML-RPC and SOAP before, feeds and publishing protocols were born in the         blogopshere and quickly moved beyond blogging. Nowadays, web service providers are using         RSS/Atom feeds and REST-based publishing protocols as lightweight alternatives to SOAP. And         developers are finding new ways to combine web services from different sites into new         applications, known as "mash-ups" in the lingo of Web 2.0. If you'd like to do the same,         then attend this talk to learn about the new IETF Atom feed format (RFC-4287) and the         soon-to-be-finalized Atom protocol, which together form a strong foundation for REST-based         web services development.
63
+</blockquote>Check it out!</div>
64
+</content>
65
+<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
66
+</entry>
67
+
68
+<entry xmlns="http://www.w3.org/2005/Atom">
69
+<author>
70
+<name>Sam Ruby</name>
71
+</author>
72
+<published>2006-07-19T14:39:00-07:00</published>
73
+<updated>2006-07-19T23:22:18Z</updated>
74
+<link href="http://www.atomenabled.org/2006/07/atomenabled-bloggers.php" rel="alternate" title="AtomEnabled Bloggers" type="text/html"/>
75
+<id>tag:blogger.com,1999:blog-6356614.post-115334590123672226</id>
76
+<title type="html">AtomEnabled Bloggers</title>
77
+<content type="xhtml" xml:base="http://www.atomenabled.org" xml:space="preserve">
78
+<div xmlns="http://www.w3.org/1999/xhtml">The following <a href="http://www.blogger.com/">Blogger</a>-generated but independently hosted weblogs have upgraded to <a href="http://www.ietf.org/rfc/rfc4287">Atom 1.0</a>:<ul>
79
+
80
+<li>
81
+<a href="http://atomenabled.org/">AtomEnabled.org</a>
82
+</li>
83
+<li>
84
+<a href="http://ceciliaschola.org/">St. Cecilia Schola Cantorum</a>
85
+</li>
86
+<li>
87
+<a href="http://robweir.com/blog/">An Antic Disposition</a>
88
+</li>
89
+</ul>
90
+<p>If your have a blogger-generated but independently hosted weblog, and your host supports PHP, you too can be on this list.</p>
91
+<ol>
92
+<li>
93
+
94
+<p>
95
+<b>Install the script</b>
96
+</p>
97
+<p>
98
+<a href="http://intertwingly.net/stories/2006/04/27/atom.php">Download</a> the script, and upload as <code style="font-size: larger;">atom.php</code>.  This file should go in the same directory as your weblog.</p>
99
+</li>
100
+<li>
101
+<p>
102
+<b>Promote the new feed</b>
103
+</p>
104
+
105
+<p>This can be done in one of two ways:</p>
106
+<ol style="list-style-type: lower-alpha; list-style-image: none; list-style-position: outside;">
107
+<li>
108
+<p>
109
+<b>Redirect</b>
110
+</p>
111
+<p>This is the most complete and comprehensive approach, however not all hosting providers allow users this level of control over the web server.  If yours does, try adding the following to a file named <code style="font-size: larger;">.htaccess</code> to the same directory that you placed the <code style="font-size: larger;">atom.php</code>:</p>
112
+<pre style="font-size: larger; margin-left: 3em;">Redirect atom.xml http://<em>your.host.name</em>/<em>path-to-blog</em>/atom.php</pre>
113
+
114
+<p>
115
+<b>Notes:</b> these instructions are for the Apache Web Server.  Instructions for other web servers, including Microsoft's IIS will differ.  You will need to tailor <em>your.host.name</em> and <em>path-to-blog</em>.</p>
116
+</li>
117
+<li>
118
+<p>
119
+<b>Advertise</b>
120
+</p>
121
+<p>The other approach is to direct your existing and new subscribers to this new feed.  Mention the change on your weblog.  Update your auto-discovery and other links.  To update your links, go into Settings / Site Feed (pictured below)<a href="http://www.atomenabled.org/uploaded_images/BloggerSiteSettings-767978.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"/>
122
+
123
+</p>
124
+<a href="http://www.atomenabled.org/uploaded_images/BloggerSiteSettings-767978.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}">
125
+<img alt="Blogger Site Settings" border="0" src="http://www.atomenabled.org/uploaded_images/BloggerSiteSettings-756299.png" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;"/>
126
+</a>
127
+<p>Once you have navigated to that page, change the <b>Site Feed URL</b> to read:</p>
128
+<pre style="font-size: larger; margin-left: 3em;">http://<em>your.host.name</em>/<em>path-to-blog</em>/atom.php</pre>
129
+<p>
130
+<b>Notes:</b> You will need to tailor <em>your.host.name</em> and <em>path-to-blog</em>.  You may also have other references on your template that need to be updated.  Once complete, republish your blog via the Posting / Status tab.</p>
131
+
132
+</li>
133
+</ol>
134
+</li>
135
+</ol>
136
+<p>If you have another Blogger produced site that has upgraded to Atom 1.0, feel free to leave a pointer to your site on the <a href="http://www.intertwingly.net/wiki/pie/AtomEnabledBloggers">Atom wiki</a>.  Once your feed has been verified, this weblog post will be updated.</p>
137
+</div>
138
+</content>
139
+<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
140
+</entry>
141
+<entry xmlns="http://www.w3.org/2005/Atom">
142
+<author>
143
+<name>Sam Ruby</name>
144
+
145
+</author>
146
+<published>2005-09-15T06:27:00-07:00</published>
147
+<updated>2005-09-15T13:33:06Z</updated>
148
+<link href="http://www.atomenabled.org/2005/09/atomenableds-atom-feed.php" rel="alternate" title="AtomEnabled's Atom Feed" type="text/html"/>
149
+<id>tag:blogger.com,1999:blog-6356614.post-112679118686717868</id>
150
+<title type="html">AtomEnabled's Atom Feed</title>
151
+<content type="xhtml" xml:base="http://www.atomenabled.org" xml:space="preserve">
152
+<div xmlns="http://www.w3.org/1999/xhtml">This site's <a href="http://www.atomenabled.org/atom.xml">Atom feed</a> has been converted to Atom 1.0.  Addionally, the Feed Validator is <a href="http://feedvalidator.org/news/archives/2005/09/15/atom_03_deprecated.html">now issuing deprecation warnings</a> whenever it encounters Atom 0.3 feeds.</div>
153
+
154
+</content>
155
+<draft xmlns="http://purl.org/atom-blog/ns#">false</draft>
156
+</entry>
157
+</feed>

+ 54
- 0
xml/rss-091.xml Näytä tiedosto

@@ -0,0 +1,54 @@
1
+<?xml version="1.0" encoding="ISO-8859-1"?>
2
+<rss version="0.91">
3
+	<channel>
4
+		<title>WriteTheWeb</title> 
5
+		<link>http://writetheweb.com</link> 
6
+		<description>News for web users that write back</description> 
7
+		<language>en-us</language> 
8
+		<copyright>Copyright 2000, WriteTheWeb team.</copyright> 
9
+		<managingEditor>editor@writetheweb.com</managingEditor> 
10
+		<webMaster>webmaster@writetheweb.com</webMaster> 
11
+		<image>
12
+
13
+			<title>WriteTheWeb</title> 
14
+			<url>http://writetheweb.com/images/mynetscape88.gif</url> 
15
+			<link>http://writetheweb.com</link> 
16
+			<width>88</width> 
17
+			<height>31</height> 
18
+			<description>News for web users that write back</description> 
19
+			</image>
20
+		<item>
21
+			<title>Giving the world a pluggable Gnutella</title> 
22
+			<link>http://writetheweb.com/read.php?item=24</link> 
23
+			<description>WorldOS is a framework on which to build programs that work like Freenet or Gnutella -allowing distributed applications using peer-to-peer routing.</description> 
24
+			</item>
25
+
26
+		<item>
27
+			<title>Syndication discussions hot up</title> 
28
+			<link>http://writetheweb.com/read.php?item=23</link> 
29
+			<description>After a period of dormancy, the Syndication mailing list has become active again, with contributions from leaders in traditional media and Web syndication.</description> 
30
+			</item>
31
+		<item>
32
+			<title>Personal web server integrates file sharing and messaging</title> 
33
+			<link>http://writetheweb.com/read.php?item=22</link> 
34
+			<description>The Magi Project is an innovative project to create a combined personal web server and messaging system that enables the sharing and synchronization of information across desktop, laptop and palmtop devices.</description> 
35
+			</item>
36
+
37
+		<item>
38
+			<title>Syndication and Metadata</title> 
39
+			<link>http://writetheweb.com/read.php?item=21</link> 
40
+			<description>RSS is probably the best known metadata format around. RDF is probably one of the least understood. In this essay, published on my O'Reilly Network weblog, I argue that the next generation of RSS should be based on RDF.</description> 
41
+			</item>
42
+		<item>
43
+			<title>UK bloggers get organised</title> 
44
+			<link>http://writetheweb.com/read.php?item=20</link> 
45
+			<description>Looks like the weblogs scene is gathering pace beyond the shores of the US. There's now a UK-specific page on weblogs.com, and a mailing list at egroups.</description> 
46
+			</item>
47
+
48
+		<item>
49
+			<title>Yournamehere.com more important than anything</title> 
50
+			<link>http://writetheweb.com/read.php?item=19</link> 
51
+			<description>Whatever you're publishing on the web, your site name is the most valuable asset you have, according to Carl Steadman.</description> 
52
+			</item>
53
+		</channel>
54
+	</rss>

+ 38
- 0
xml/rss-092.xml Näytä tiedosto

@@ -0,0 +1,38 @@
1
+<?xml version="1.0"?>
2
+<!-- RSS generation done by 'Radio UserLand' on Fri, 13 Apr 2001 19:23:02 GMT -->
3
+<rss version="0.92">
4
+	<channel>
5
+		<title>Dave Winer: Grateful Dead</title>
6
+		<link>http://www.scripting.com/blog/categories/gratefulDead.html</link>
7
+		<description>A high-fidelity Grateful Dead song every day. This is where we're experimenting with enclosures on RSS news items that download when you're not using your computer. If it works (it will) it will be the end of the Click-And-Wait multimedia experience on the Internet. </description>
8
+		<lastBuildDate>Fri, 13 Apr 2001 19:23:02 GMT</lastBuildDate>
9
+
10
+		<docs>http://backend.userland.com/rss092</docs>
11
+		<managingEditor>dave@userland.com (Dave Winer)</managingEditor>
12
+		<webMaster>dave@userland.com (Dave Winer)</webMaster>
13
+		<cloud domain="data.ourfavoritesongs.com" port="80" path="/RPC2" registerProcedure="ourFavoriteSongs.rssPleaseNotify" protocol="xml-rpc"/>
14
+		<item>
15
+			<description>It's been a few days since I added a song to the Grateful Dead channel. Now that there are all these new Radio users, many of whom are tuned into this channel (it's #16 on the hotlist of upstreaming Radio users, there's no way of knowing how many non-upstreaming users are subscribing, have to do something about this..). Anyway, tonight's song is a live version of Weather Report Suite from Dick's Picks Volume 7. It's wistful music. Of course a beautiful song, oft-quoted here on Scripting News. &lt;i&gt;A little change, the wind and rain.&lt;/i&gt;
16
+
17
+</description>
18
+			<enclosure url="http://www.scripting.com/mp3s/weatherReportDicksPicsVol7.mp3" length="6182912" type="audio/mpeg"/>
19
+			</item>
20
+		<item>
21
+			<description>Kevin Drennan started a &lt;a href="http://deadend.editthispage.com/"&gt;Grateful Dead Weblog&lt;/a&gt;. Hey it's cool, he even has a &lt;a href="http://deadend.editthispage.com/directory/61"&gt;directory&lt;/a&gt;. &lt;i&gt;A Frontier 7 feature.&lt;/i&gt;</description>
22
+
23
+			<source url="http://scriptingnews.userland.com/xml/scriptingNews2.xml">Scripting News</source>
24
+			</item>
25
+		<item>
26
+			<description>&lt;a href="http://arts.ucsc.edu/GDead/AGDL/other1.html"&gt;The Other One&lt;/a&gt;, live instrumental, One From The Vault. Very rhythmic very spacy, you can listen to it many times, and enjoy something new every time.</description>
27
+			<enclosure url="http://www.scripting.com/mp3s/theOtherOne.mp3" length="6666097" type="audio/mpeg"/>
28
+			</item>
29
+
30
+		<item>
31
+			<description>This is a test of a change I just made. Still diggin..</description>
32
+			</item>
33
+		<item>
34
+			<description>The HTML rendering almost &lt;a href="http://validator.w3.org/check/referer"&gt;validates&lt;/a&gt;. Close. Hey I wonder if anyone has ever published a style guide for ALT attributes on images? What are you supposed to say in the ALT attribute? I sure don't know. If you're blind send me an email if u cn rd ths. </description>
35
+			</item>
36
+
37
+		</channel>
38
+	</rss>

+ 53
- 0
xml/rss-10.xml Näytä tiedosto

@@ -0,0 +1,53 @@
1
+<?xml version="1.0"?>
2
+
3
+<rdf:RDF 
4
+  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
5
+  xmlns="http://purl.org/rss/1.0/"
6
+>
7
+
8
+  <channel rdf:about="http://www.xml.com/xml/news.rss">
9
+    <title>XML.com</title>
10
+    <link>http://xml.com/pub</link>
11
+    <description>
12
+      XML.com features a rich mix of information and services 
13
+      for the XML community.
14
+    </description>
15
+
16
+    <image rdf:resource="http://xml.com/universal/images/xml_tiny.gif" />
17
+
18
+    <items>
19
+      <rdf:Seq>
20
+        <rdf:li resource="http://xml.com/pub/2000/08/09/xslt/xslt.html" />
21
+        <rdf:li resource="http://xml.com/pub/2000/08/09/rdfdb/index.html" />
22
+      </rdf:Seq>
23
+    </items>
24
+
25
+  </channel>
26
+  
27
+  <image rdf:about="http://xml.com/universal/images/xml_tiny.gif">
28
+    <title>XML.com</title>
29
+    <link>http://www.xml.com</link>
30
+    <url>http://xml.com/universal/images/xml_tiny.gif</url>
31
+  </image>
32
+  
33
+  <item rdf:about="http://xml.com/pub/2000/08/09/xslt/xslt.html">
34
+    <title>Processing Inclusions with XSLT</title>
35
+    <link>http://xml.com/pub/2000/08/09/xslt/xslt.html</link>
36
+    <description>
37
+     Processing document inclusions with general XML tools can be 
38
+     problematic. This article proposes a way of preserving inclusion 
39
+     information through SAX-based processing.
40
+    </description>
41
+  </item>
42
+  
43
+  <item rdf:about="http://xml.com/pub/2000/08/09/rdfdb/index.html">
44
+    <title>Putting RDF to Work</title>
45
+    <link>http://xml.com/pub/2000/08/09/rdfdb/index.html</link>
46
+    <description>
47
+     Tool and API support for the Resource Description Framework 
48
+     is slowly coming of age. Edd Dumbill takes a look at RDFDB, 
49
+     one of the most exciting new RDF toolkits.
50
+    </description>
51
+  </item>
52
+
53
+</rdf:RDF>

+ 47
- 0
xml/rss-20.xml Näytä tiedosto

@@ -0,0 +1,47 @@
1
+<?xml version="1.0"?>
2
+<rss version="2.0">
3
+   <channel>
4
+      <title>Liftoff News</title>
5
+      <link>http://liftoff.msfc.nasa.gov/</link>
6
+      <description>Liftoff to Space Exploration.</description>
7
+      <language>en-us</language>
8
+      <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
9
+
10
+      <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
11
+      <docs>http://blogs.law.harvard.edu/tech/rss</docs>
12
+      <generator>Weblog Editor 2.0</generator>
13
+      <managingEditor>editor@example.com</managingEditor>
14
+      <webMaster>webmaster@example.com</webMaster>
15
+      <item>
16
+
17
+         <title>Star City</title>
18
+         <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
19
+         <description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's &lt;a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm"&gt;Star City&lt;/a&gt;.</description>
20
+         <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
21
+         <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
22
+
23
+      </item>
24
+      <item>
25
+         <description>Sky watchers in Europe, Asia, and parts of Alaska and Canada will experience a &lt;a href="http://science.nasa.gov/headlines/y2003/30may_solareclipse.htm"&gt;partial eclipse of the Sun&lt;/a&gt; on Saturday, May 31st.</description>
26
+         <pubDate>Fri, 30 May 2003 11:06:42 GMT</pubDate>
27
+         <guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572</guid>
28
+
29
+      </item>
30
+      <item>
31
+         <title>The Engine That Does More</title>
32
+         <link>http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</link>
33
+         <description>Before man travels to Mars, NASA hopes to design new engines that will let us fly through the Solar System more quickly.  The proposed VASIMR engine would do that.</description>
34
+         <pubDate>Tue, 27 May 2003 08:37:32 GMT</pubDate>
35
+         <guid>http://liftoff.msfc.nasa.gov/2003/05/27.html#item571</guid>
36
+
37
+      </item>
38
+      <item>
39
+         <title>Astronauts' Dirty Laundry</title>
40
+         <link>http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp</link>
41
+         <description>Compared to earlier spacecraft, the International Space Station has many luxuries, but laundry facilities are not one of them.  Instead, astronauts have other options.</description>
42
+         <pubDate>Tue, 20 May 2003 08:56:02 GMT</pubDate>
43
+         <guid>http://liftoff.msfc.nasa.gov/2003/05/20.html#item570</guid>
44
+
45
+      </item>
46
+   </channel>
47
+</rss>

Loading…
Peruuta
Tallenna