From a1d2eef53e0e333a1a50c10e63571cb5f25c335d Mon Sep 17 00:00:00 2001
From: Philipp Bock <p@philippbock.de>
Date: Mon, 25 Dec 2017 22:09:28 +0100
Subject: [PATCH 1/3] Use baseUrl instead of hardcoded year for Fahrplan link

---
 index.js        | 6 +++---
 lib/parse.js    | 3 ++-
 lib/template.js | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index 4d9a183..77a40e9 100755
--- a/index.js
+++ b/index.js
@@ -16,7 +16,7 @@ const program = require('commander');
 function logExamples() {
 	console.log('  Examples:');
 	console.log('');
-	console.log('     $ curl https://events.ccc.de/congress/2016/Fahrplan/schedule.xml | c3t-pad');
+	console.log('     $ curl https://events.ccc.de/congress/2017/Fahrplan/schedule.xml | c3t-pad');
 	console.log('     $ c3t-pad -o myoutdir/ < schedule.xml');
 	console.log('');
 }
@@ -35,7 +35,7 @@ if (process.stdin.isTTY) {
 
 streamToPromise(process.stdin)
 	.then(parse)
-	.then(({ title, version, days, acronym }) => {
+	.then(({ title, version, days, acronym, baseUrl }) => {
 		// Find the most common event type.
 		// It will get ignored in the template (this is useful because
 		// nearly all events at CCC are set to "lecture").
@@ -47,7 +47,7 @@ streamToPromise(process.stdin)
 			.maxBy(1)[0];
 
 		// Initialise the template
-		const dayTemplate = Template({ ignoreEventTypes: [ mostCommonEventType ], title, version, acronym });
+		const dayTemplate = Template({ ignoreEventTypes: [ mostCommonEventType ], title, version, acronym, baseUrl });
 
 		try {
 			fs.mkdirSync(program.outputDir);
diff --git a/lib/parse.js b/lib/parse.js
index 2844216..b12e477 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -8,6 +8,7 @@ module.exports = function parse(xml) {
 	const version = $('schedule version').text();
 	const title = $('conference title').text();
 	const acronym = $('conference acronym').text();
+	const baseUrl = $('conference base_url').text();
 
 	const days = $('day').map((i, day) => {
 		const $day = $(day);
@@ -58,5 +59,5 @@ module.exports = function parse(xml) {
 		}
 	}).get();
 
-	return { days, title, version, acronym };
+	return { days, title, version, acronym, baseUrl };
 }
diff --git a/lib/template.js b/lib/template.js
index 1d2af0b..364d9b0 100644
--- a/lib/template.js
+++ b/lib/template.js
@@ -55,7 +55,7 @@ module.exports = function Template(options) {
 			[${language}] <strong>${start}</strong> +${duration}, ${room}<br>
 			<strong>${title}</strong>${type}<br>
 			${speakers}<br>
-			Fahrplan: https://fahrplan.events.ccc.de/congress/2016/Fahrplan/events/${id}.html<br>
+			Fahrplan: ${options.baseUrl}events/${id}.html<br>
 			Slides (if available): https://speakers.c3lingo.org/talks/${guid}/<br>
 			${targetLanguages}<br>
 			<br>

From e66f13c8ff9f19577f9f4f07ad288b07f908158d Mon Sep 17 00:00:00 2001
From: Philipp Bock <p@philippbock.de>
Date: Mon, 25 Dec 2017 22:10:04 +0100
Subject: [PATCH 2/3] Add colons after language codes

---
 lib/template.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/template.js b/lib/template.js
index 364d9b0..8f68e68 100644
--- a/lib/template.js
+++ b/lib/template.js
@@ -44,8 +44,8 @@ module.exports = function Template(options) {
 		const type = o.ignoreEventTypes.includes(event.type) ? '' : ` (${_.upperFirst(event.type)})`;
 
 		const targetLanguages = ({
-			en: '→ de ',
-			de: '→ en ',
+			en: '→ de: ',
+			de: '→ en: ',
 		})[language] || '→ ';
 
 		// Yes, this is awful HTML, but its only job is to be parsed by EtherPad,

From 875e25387af8b8b103d357bf4a41aa8f1a2f1e3b Mon Sep 17 00:00:00 2001
From: Philipp Bock <p@philippbock.de>
Date: Mon, 25 Dec 2017 22:12:28 +0100
Subject: [PATCH 3/3] Update year in example and bump version

---
 README.md    | 2 +-
 package.json | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index b5c17ec..39df98b 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ $ npm install -g c3t-pad
 Once installed, you can get the most recent schedule and turn it into Etherpad files:
 
 ```sh
-$ curl https://events.ccc.de/congress/2016/Fahrplan/schedule.xml | c3t-pad
+$ curl https://events.ccc.de/congress/2017/Fahrplan/schedule.xml | c3t-pad
 ```
 
 Of course, the XML doesn't have to come from curl; you can just as well pipe in a local file.
diff --git a/package.json b/package.json
index 652d440..6ff825c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "c3t-pad",
-  "version": "0.2.0",
+  "version": "0.2.1",
   "description": "Convert Chaos Communication Congress schedule into pads for the translation team",
   "main": "index.js",
   "scripts": {