20-rss.js 5.2 KB

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