20-rss.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. (function () {
  2. function RunningInNode () {
  3. return(
  4. (typeof require) == "function"
  5. &&
  6. (typeof exports) == "object"
  7. &&
  8. (typeof module) == "object"
  9. &&
  10. (typeof __filename) == "string"
  11. &&
  12. (typeof __dirname) == "string"
  13. );
  14. }
  15. if (!RunningInNode()) {
  16. if (!this.Tautologistics)
  17. this.Tautologistics = {};
  18. if (!this.Tautologistics.NodeHtmlParser)
  19. this.Tautologistics.NodeHtmlParser = {};
  20. if (!this.Tautologistics.NodeHtmlParser.Tests)
  21. this.Tautologistics.NodeHtmlParser.Tests = [];
  22. exports = {};
  23. this.Tautologistics.NodeHtmlParser.Tests.push(exports);
  24. }
  25. exports.name = "RSS (2.0)";
  26. exports.options = {
  27. handler: {}
  28. , parser: {}
  29. };
  30. exports.type = "rss";
  31. //http://cyber.law.harvard.edu/rss/examples/rss2sample.xml
  32. exports.html = '<?xml version="1.0"?>\
  33. <rss version="2.0">\
  34. <channel>\
  35. <title>Liftoff News</title>\
  36. <link>http://liftoff.msfc.nasa.gov/</link>\
  37. <description>Liftoff to Space Exploration.</description>\
  38. <language>en-us</language>\
  39. <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>\
  40. \
  41. <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>\
  42. <docs>http://blogs.law.harvard.edu/tech/rss</docs>\
  43. <generator>Weblog Editor 2.0</generator>\
  44. <managingEditor>editor@example.com</managingEditor>\
  45. <webMaster>webmaster@example.com</webMaster>\
  46. <item>\
  47. \
  48. <title>Star City</title>\
  49. <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>\
  50. <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>\
  51. <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>\
  52. <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>\
  53. \
  54. </item>\
  55. <item>\
  56. <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>\
  57. <pubDate>Fri, 30 May 2003 11:06:42 GMT</pubDate>\
  58. <guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572</guid>\
  59. \
  60. </item>\
  61. <item>\
  62. <title>The Engine That Does More</title>\
  63. <link>http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</link>\
  64. <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>\
  65. <pubDate>Tue, 27 May 2003 08:37:32 GMT</pubDate>\
  66. <guid>http://liftoff.msfc.nasa.gov/2003/05/27.html#item571</guid>\
  67. \
  68. </item>\
  69. <item>\
  70. <title>Astronauts\' Dirty Laundry</title>\
  71. <link>http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp</link>\
  72. <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>\
  73. <pubDate>Tue, 20 May 2003 08:56:02 GMT</pubDate>\
  74. <guid>http://liftoff.msfc.nasa.gov/2003/05/20.html#item570</guid>\
  75. \
  76. </item>\
  77. </channel>\
  78. </rss>';
  79. exports.expected = {
  80. type: "rss"
  81. , id: ""
  82. , title: "Liftoff News"
  83. , link: "http://liftoff.msfc.nasa.gov/"
  84. , description: "Liftoff to Space Exploration."
  85. , updated: new Date("Tue, 10 Jun 2003 09:41:01 GMT")
  86. , author: "editor@example.com"
  87. , items: [
  88. {
  89. id: "http://liftoff.msfc.nasa.gov/2003/06/03.html#item573"
  90. , title: "Star City"
  91. , link: "http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp"
  92. , 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;."
  93. , pubDate: new Date("Tue, 03 Jun 2003 09:39:21 GMT")
  94. }
  95. , {
  96. id: "http://liftoff.msfc.nasa.gov/2003/05/30.html#item572"
  97. , 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."
  98. , pubDate: new Date("Fri, 30 May 2003 11:06:42 GMT")
  99. }
  100. , {
  101. id: "http://liftoff.msfc.nasa.gov/2003/05/27.html#item571"
  102. , title: "The Engine That Does More"
  103. , link: "http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp"
  104. , 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."
  105. , pubDate: new Date("Tue, 27 May 2003 08:37:32 GMT")
  106. }
  107. , {
  108. id: "http://liftoff.msfc.nasa.gov/2003/05/20.html#item570"
  109. , title: "Astronauts' Dirty Laundry"
  110. , link: "http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp"
  111. , 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."
  112. , pubDate: new Date("Tue, 20 May 2003 08:56:02 GMT")
  113. }
  114. ]
  115. };
  116. })();