| 
									
										
										
										
											2008-02-16 23:17:41 -05:00
										 |  |  | USING: rss io kernel io.files tools.test io.encodings.utf8 ;
 | 
					
						
							| 
									
										
										
										
											2008-03-08 05:27:19 -05:00
										 |  |  | IN: rss.tests | 
					
						
							| 
									
										
										
										
											2007-11-28 22:52:22 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : load-news-file ( filename -- feed )
 | 
					
						
							|  |  |  |     #! Load an news syndication file and process it, returning | 
					
						
							|  |  |  |     #! it as an feed tuple. | 
					
						
							| 
									
										
										
										
											2008-02-16 23:17:41 -05:00
										 |  |  |     utf8 <file-reader> read-feed ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ T{ | 
					
						
							|  |  |  |     feed | 
					
						
							|  |  |  |     f
 | 
					
						
							|  |  |  |     "Meerkat" | 
					
						
							|  |  |  |     "http://meerkat.oreillynet.com" | 
					
						
							| 
									
										
										
										
											2008-01-01 22:30:22 -05:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         T{ | 
					
						
							|  |  |  |             entry | 
					
						
							|  |  |  |             f
 | 
					
						
							|  |  |  |             "XML: A Disruptive Technology" | 
					
						
							|  |  |  |             "http://c.moreover.com/click/here.pl?r123" | 
					
						
							|  |  |  |             "\n      XML is placing increasingly heavy loads on the existing technical\n      infrastructure of the Internet.\n    " | 
					
						
							|  |  |  |             f
 | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } ] [ "extra/rss/rss1.xml" resource-path load-news-file ] unit-test | 
					
						
							|  |  |  | [ T{ | 
					
						
							|  |  |  |     feed | 
					
						
							|  |  |  |     f
 | 
					
						
							|  |  |  |     "dive into mark" | 
					
						
							|  |  |  |     "http://example.org/" | 
					
						
							| 
									
										
										
										
											2008-01-01 22:30:22 -05:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  |         T{ | 
					
						
							|  |  |  |             entry | 
					
						
							|  |  |  |             f
 | 
					
						
							|  |  |  |             "Atom draft-07 snapshot" | 
					
						
							|  |  |  |             "http://example.org/2005/04/02/atom" | 
					
						
							|  |  |  |             "\n         <div xmlns=\"http://www.w3.org/1999/xhtml\">\n           <p><i>[Update: The Atom draft is finished.]</i></p>\n         </div>\n       " | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             "2003-12-13T08:29:29-04:00" | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } ] [ "extra/rss/atom.xml" resource-path load-news-file ] unit-test |