write-you-a-haskell/misc/rssgen.py

90 lines
3.2 KiB
Python
Raw Permalink Normal View History

2015-01-06 18:09:41 +03:00
import datetime
import PyRSS2Gen
jan = datetime.datetime(2015, 1, 1, 0, 0)
feb = datetime.datetime(2015, 2, 1, 0, 0)
mar = datetime.datetime(2015, 3, 1, 0, 0)
apr = datetime.datetime(2015, 4, 1, 0, 0)
may = datetime.datetime(2015, 5, 1, 0, 0)
jun = datetime.datetime(2015, 6, 1, 0, 0)
jul = datetime.datetime(2015, 7, 1, 0, 0)
aug = datetime.datetime(2015, 8, 1, 0, 0)
pages = [
PyRSS2Gen.RSSItem(
title = "Introduction",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/000_introduction.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/000_introduction.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(1) ),
PyRSS2Gen.RSSItem(
title = "Haskell Basics",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/001_basics.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/001_basics.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(2) ),
PyRSS2Gen.RSSItem(
title = "Parsing",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/002_parsers.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/002_parsers.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(3)),
PyRSS2Gen.RSSItem(
title = "Lambda Calculus",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/003_lambda_calculus.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/003_lambda_calculus.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(4)),
PyRSS2Gen.RSSItem(
title = "Type Systems",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/004_type_systems.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/004_type_systems.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(5)),
PyRSS2Gen.RSSItem(
title = "Evaluation",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/005_evaluation.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/005_evaluation.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(6)),
PyRSS2Gen.RSSItem(
title = "Hindley-Milner Inference",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/006_hindley_milner.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/006_hindley_milner.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(7)),
PyRSS2Gen.RSSItem(
title = "Design of ProtoHaskell",
2015-01-24 22:37:01 +03:00
link = "http://dev.stephendiehl.com/fun/007_path.html",
2015-01-06 18:09:41 +03:00
description = "",
2015-01-24 22:37:01 +03:00
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/007_path.html"),
2015-01-06 18:09:41 +03:00
pubDate = jan + datetime.timedelta(8)),
2015-01-24 22:37:01 +03:00
PyRSS2Gen.RSSItem(
title = "Extended Parser",
link = "http://dev.stephendiehl.com/fun/008_extended_parser.html",
description = "",
guid = PyRSS2Gen.Guid("http://dev.stephendiehl.com/fun/008_extended_parser.html"),
pubDate = datetime.datetime(2015, 1, 24, 14, 30, 28, 996866))
2015-01-06 18:09:41 +03:00
]
rss = PyRSS2Gen.RSS2(
title = "Write You A Haskell",
link = "http://dev.stephendiehl.com/",
description = "Building a modern functional compiler from first principles.",
lastBuildDate = datetime.datetime.now(),
items = pages
)
if __name__ == '__main__':
print "Generating RSS Feeding: atom.xml"
rss.write_xml(open("atom.xml", "w"))