<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.piratenbrandenburg.de/index.php?action=history&amp;feed=atom&amp;title=Benutzer%3AHub%2Fantragsfabrik-openslides-export.py</id>
	<title>Benutzer:Hub/antragsfabrik-openslides-export.py - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.piratenbrandenburg.de/index.php?action=history&amp;feed=atom&amp;title=Benutzer%3AHub%2Fantragsfabrik-openslides-export.py"/>
	<link rel="alternate" type="text/html" href="https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;action=history"/>
	<updated>2026-04-04T08:19:54Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in PiratenWiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;diff=62489&amp;oldid=prev</id>
		<title>Hub: move to Github</title>
		<link rel="alternate" type="text/html" href="https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;diff=62489&amp;oldid=prev"/>
		<updated>2012-08-27T13:05:09Z</updated>

		<summary type="html">&lt;p&gt;move to Github&lt;/p&gt;
&lt;a href=&quot;https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;amp;diff=62489&amp;amp;oldid=56171&quot;&gt;Änderungen zeigen&lt;/a&gt;</summary>
		<author><name>Hub</name></author>
	</entry>
	<entry>
		<id>https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;diff=56171&amp;oldid=prev</id>
		<title>Hub: update Reihenfolge aus TO auslesen</title>
		<link rel="alternate" type="text/html" href="https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;diff=56171&amp;oldid=prev"/>
		<updated>2012-06-20T10:06:07Z</updated>

		<summary type="html">&lt;p&gt;update Reihenfolge aus TO auslesen&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 20. Juni 2012, 10:06 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Zeile 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  &lt;/del&gt;#!/usr/bin/env python&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/usr/bin/env python&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   # -*- coding: utf-8 -*-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   # -*- coding: utf-8 -*-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   import urllib2&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   import urllib2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot;&gt;Zeile 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if application[&amp;quot;Eingereicht&amp;quot;] != &amp;quot;&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if application[&amp;quot;Eingereicht&amp;quot;] != &amp;quot;&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           applications_for_category.append(application)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;           applications_for_category.append(application)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       applications_for_category.sort(key = lambda &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;x&lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;x&lt;/del&gt;[&amp;quot;Titel&amp;quot;])&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       applications_for_category.sort(key = lambda &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a&lt;/ins&gt;[&amp;quot;Titel&amp;quot;])&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       applications[category] = applications_for_category&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       applications[category] = applications_for_category&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return applications&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     return applications&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l134&quot;&gt;Zeile 134:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 134:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   def write_content(applications):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   def write_content(applications&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, applications_position=[]&lt;/ins&gt;):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    open_position = []&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    open_position.extend(applications_position)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     for category in applications:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     for category in applications:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       f = open(category,&amp;#039;w+&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       f = open(category,&amp;#039;w+&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l141&quot;&gt;Zeile 141:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 143:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                         &amp;quot;Submitter (First Name)&amp;quot;,&amp;quot;Submitter (Last Name)&amp;quot;))&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                         &amp;quot;Submitter (First Name)&amp;quot;,&amp;quot;Submitter (Last Name)&amp;quot;))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       for a in applications[category]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       for a in applications[category]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writer.writerow( ( &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;quot;&amp;quot;&lt;/del&gt;,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        try:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          number = applications_position.index(a[&amp;quot;Titel&amp;quot;]) + 1&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          open_position.remove(a[&amp;quot;Titel&amp;quot;])&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        except ValueError:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          print &amp;#039;&amp;quot;&amp;#039; + a[&amp;quot;Titel&amp;quot;] + &amp;#039;&amp;quot; im Antragsbuch nicht gefunden&amp;#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;          number = &amp;quot;&amp;quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         writer.writerow( ( &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;number&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# number starts at 1&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                           a[&amp;quot;Titel&amp;quot;].encode(&amp;#039;utf8&amp;#039;),&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                           a[&amp;quot;Titel&amp;quot;].encode(&amp;#039;utf8&amp;#039;),&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                           filter_content(a[&amp;quot;Antragstext&amp;quot;].encode(&amp;#039;utf8&amp;#039;)),&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                           filter_content(a[&amp;quot;Antragstext&amp;quot;].encode(&amp;#039;utf8&amp;#039;)),&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l149&quot;&gt;Zeile 149:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 157:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       f.flush()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       f.flush()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       f.close()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       f.close()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    if open_position != []:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      print &quot;Anträge aus dem Antragsbuch, die nicht gefunden wurden: &quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;      for a in open_position:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        print a&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  def get_application_positions(filename):&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    f = open(filename,&#039;r&#039;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    lines = [l.strip().decode(&#039;utf8&#039;) for l in f.readlines()]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    return lines&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   if __name__ == &amp;#039;__main__&amp;#039;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   if __name__ == &amp;#039;__main__&amp;#039;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l156&quot;&gt;Zeile 156:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 173:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     content = list_content(applications)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     content = list_content(applications)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     applications = parse_content(content)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     applications = parse_content(content)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     write_content(applications)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    #Ein Titel per Zeile, TO-Reihenfolge gegeben&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    #positions = get_application_positions(&amp;quot;reihenfolge-to&amp;quot;) &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     write_content(applications&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, positions&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key c1ppbbwiki:diff::1.12:old-55897:rev-56171 --&gt;
&lt;/table&gt;</summary>
		<author><name>Hub</name></author>
	</entry>
	<entry>
		<id>https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;diff=55897&amp;oldid=prev</id>
		<title>Hub: Script zum scrappen von Anträgen aus dem BB Listing in openslides csv.</title>
		<link rel="alternate" type="text/html" href="https://wiki.piratenbrandenburg.de/index.php?title=Benutzer:Hub/antragsfabrik-openslides-export.py&amp;diff=55897&amp;oldid=prev"/>
		<updated>2012-06-15T13:15:13Z</updated>

		<summary type="html">&lt;p&gt;Script zum scrappen von Anträgen aus dem BB Listing in openslides csv.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;  #!/usr/bin/env python&lt;br /&gt;
  # -*- coding: utf-8 -*-&lt;br /&gt;
  import urllib2&lt;br /&gt;
  import json&lt;br /&gt;
  import os &lt;br /&gt;
  import csv&lt;br /&gt;
&lt;br /&gt;
  API_URL = &amp;quot;http://wiki.piratenbrandenburg.de/api.php&amp;quot;&lt;br /&gt;
  CATEGORIES = [&amp;quot;Kategorie:Sonstiger_Antrag_AF_LPT_2012.1&amp;quot;,&lt;br /&gt;
                &amp;quot;Kategorie:Satzungsänderungsantrag_AF_LPT_2012.1&amp;quot;,&lt;br /&gt;
                &amp;quot;Kategorie:Programmantrag_AF_LPT_2012.1&amp;quot;]&lt;br /&gt;
  MAX_PAGEIDS = 50&lt;br /&gt;
&lt;br /&gt;
  def get_json(endpoint):&lt;br /&gt;
    url = &amp;#039;&amp;#039;.join([&lt;br /&gt;
             API_URL,&lt;br /&gt;
             &amp;#039;?&amp;#039;,&lt;br /&gt;
             endpoint,&lt;br /&gt;
             &amp;#039;&amp;amp;format=json&amp;#039;,&lt;br /&gt;
             ])&lt;br /&gt;
    return urllib2.urlopen(url).read()&lt;br /&gt;
&lt;br /&gt;
  def get_category(category, query_continue=&amp;quot;&amp;quot;):&lt;br /&gt;
    data = get_json(&amp;quot;action=query&amp;amp;list=categorymembers&amp;amp;cmtitle=%s&amp;amp;cmcontinue=%s&amp;quot; % (category, query_continue))&lt;br /&gt;
    json_data = json.loads(data)&lt;br /&gt;
    pages = json_data[&amp;quot;query&amp;quot;][&amp;quot;categorymembers&amp;quot;]&lt;br /&gt;
    if &amp;quot;query-continue&amp;quot; in json_data:&lt;br /&gt;
      pages += get_category(category,json_data[&amp;quot;query-continue&amp;quot;][&amp;quot;categorymembers&amp;quot;][&amp;quot;cmcontinue&amp;quot;])&lt;br /&gt;
    return pages&lt;br /&gt;
&lt;br /&gt;
  def list_applications(categories):&lt;br /&gt;
    if os.path.isfile(&amp;quot;application_list&amp;quot;):&lt;br /&gt;
      f = open(&amp;#039;application_list&amp;#039;,&amp;#039;r&amp;#039;)&lt;br /&gt;
      return json.load(f)&lt;br /&gt;
    return download_applications(categories)&lt;br /&gt;
&lt;br /&gt;
  def download_applications(categories):&lt;br /&gt;
    applications = _list_applications(categories)&lt;br /&gt;
    f = open(&amp;#039;application_list&amp;#039;,&amp;#039;w+&amp;#039;)&lt;br /&gt;
    json.dump(applications, f)&lt;br /&gt;
    f.flush()&lt;br /&gt;
    return applications&lt;br /&gt;
&lt;br /&gt;
  def _list_applications(categories):&lt;br /&gt;
    applications = {}&lt;br /&gt;
    for category in categories:&lt;br /&gt;
      pages = get_category(category)&lt;br /&gt;
      applications[category] = pages&lt;br /&gt;
    return applications&lt;br /&gt;
&lt;br /&gt;
  def get_raw_pageid(pageid):&lt;br /&gt;
    data = get_json(&amp;quot;action=query&amp;amp;prop=revisions&amp;amp;rvprop=content&amp;amp;pageids=%s&amp;quot; % pageid)&lt;br /&gt;
    json_data = json.loads(data)&lt;br /&gt;
    pages = json_data[&amp;quot;query&amp;quot;][&amp;quot;pages&amp;quot;]&lt;br /&gt;
    content = []&lt;br /&gt;
    for pageids in pages:&lt;br /&gt;
      content += pages[pageids][&amp;quot;revisions&amp;quot;]&lt;br /&gt;
    return content&lt;br /&gt;
&lt;br /&gt;
  def chunks(l, n):&lt;br /&gt;
    for i in xrange(0, len(l), n):&lt;br /&gt;
      yield l[i:i+n]&lt;br /&gt;
&lt;br /&gt;
  def get_pageid(pageids):&lt;br /&gt;
    pages = []&lt;br /&gt;
    for chunk in chunks(pageids, MAX_PAGEIDS):&lt;br /&gt;
      pages += get_raw_pageid(&amp;quot;|&amp;quot;.join(str(i) for i in chunk))&lt;br /&gt;
    return pages&lt;br /&gt;
&lt;br /&gt;
  def _list_content(applications):&lt;br /&gt;
    pageids = {}&lt;br /&gt;
    content = {}&lt;br /&gt;
    for category in applications.iterkeys():&lt;br /&gt;
      for application in applications[category]:&lt;br /&gt;
        if category in pageids:&lt;br /&gt;
          pageids[category] += [application[&amp;quot;pageid&amp;quot;]]&lt;br /&gt;
        else:&lt;br /&gt;
          pageids[category] = [application[&amp;quot;pageid&amp;quot;]]&lt;br /&gt;
      content[category] = get_pageid(pageids[category])&lt;br /&gt;
    return content&lt;br /&gt;
&lt;br /&gt;
  def download_content(applications):&lt;br /&gt;
    content = _list_content(applications)&lt;br /&gt;
    f = open(&amp;#039;content&amp;#039;,&amp;#039;w+&amp;#039;)&lt;br /&gt;
    json.dump(content,f)&lt;br /&gt;
    f.flush()&lt;br /&gt;
    return content&lt;br /&gt;
&lt;br /&gt;
  def list_content(applications):&lt;br /&gt;
    if os.path.isfile(&amp;quot;content&amp;quot;):&lt;br /&gt;
      f = open(&amp;#039;content&amp;#039;,&amp;#039;r&amp;#039;)&lt;br /&gt;
      return json.load(f)&lt;br /&gt;
    return download_content(applications)&lt;br /&gt;
&lt;br /&gt;
  def parse_content(content):&lt;br /&gt;
    applications = {}&lt;br /&gt;
    for category in content.iterkeys():&lt;br /&gt;
      applications_for_category = []&lt;br /&gt;
      for application_content in content[category]:&lt;br /&gt;
        application = mediawiki_template(application_content[&amp;quot;*&amp;quot;])&lt;br /&gt;
        if application[&amp;quot;Eingereicht&amp;quot;] != &amp;quot;&amp;quot;:&lt;br /&gt;
          applications_for_category.append(application)&lt;br /&gt;
      applications_for_category.sort(key = lambda x: x[&amp;quot;Titel&amp;quot;])&lt;br /&gt;
      applications[category] = applications_for_category&lt;br /&gt;
    return applications&lt;br /&gt;
&lt;br /&gt;
  def mediawiki_template(mw_string):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot; returns media wiki template element as a hash&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    #Split content inside Template&lt;br /&gt;
    strings = mw_string.split(&amp;quot;{{&amp;quot;)[1].split(&amp;quot;}}&amp;quot;)[0].split(&amp;quot;\n|&amp;quot;)&lt;br /&gt;
    #remove &amp;quot;Antragsfabrikat&amp;quot;&lt;br /&gt;
    strings = strings[1:]&lt;br /&gt;
    mw_hash = {}&lt;br /&gt;
    for string in strings:&lt;br /&gt;
      keyval = string.split(&amp;quot;=&amp;quot;,1)&lt;br /&gt;
      if 2 != len(keyval):&lt;br /&gt;
        raise SyntaxError(&amp;quot;Mediawiki parsing Error %s&amp;quot; % keyval)&lt;br /&gt;
      keyval = [s.strip() for s in keyval]&lt;br /&gt;
      key, val = keyval&lt;br /&gt;
      mw_hash[key] = val&lt;br /&gt;
    return mw_hash&lt;br /&gt;
&lt;br /&gt;
  def filter_content(content):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot; simple filter for some html tags to plain text&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&amp;quot;,&amp;quot;¹&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;quot;,&amp;quot;²&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;&amp;quot;,&amp;quot;³&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;br&amp;gt;&amp;quot;,&amp;quot;\n&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;br\&amp;gt;&amp;quot;,&amp;quot;\n&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;br\\n&amp;gt;&amp;quot;,&amp;quot;\n&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;,&amp;quot;\n&amp;quot;)&lt;br /&gt;
    content = content.replace(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;,&amp;quot;\n&amp;quot;)&lt;br /&gt;
    return content&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  def write_content(applications):&lt;br /&gt;
    for category in applications:&lt;br /&gt;
      f = open(category,&amp;#039;w+&amp;#039;)&lt;br /&gt;
      writer = csv.writer(f,delimiter=&amp;#039;,&amp;#039;, quotechar=&amp;#039;&amp;quot;&amp;#039;, quoting=csv.QUOTE_ALL)&lt;br /&gt;
      writer.writerow( (&amp;quot;Number&amp;quot;,&amp;quot;Title&amp;quot;,&amp;quot;Text&amp;quot;,&amp;quot;Reason&amp;quot;,&lt;br /&gt;
                        &amp;quot;Submitter (First Name)&amp;quot;,&amp;quot;Submitter (Last Name)&amp;quot;))&lt;br /&gt;
      for a in applications[category]:&lt;br /&gt;
        writer.writerow( ( &amp;quot;&amp;quot;,&lt;br /&gt;
                          a[&amp;quot;Titel&amp;quot;].encode(&amp;#039;utf8&amp;#039;),&lt;br /&gt;
                          filter_content(a[&amp;quot;Antragstext&amp;quot;].encode(&amp;#039;utf8&amp;#039;)),&lt;br /&gt;
                          filter_content(a[u&amp;#039;Begr\xfcndung&amp;#039;].encode(&amp;#039;utf8&amp;#039;)),&lt;br /&gt;
                          a[&amp;quot;Antragsteller&amp;quot;].encode(&amp;#039;utf8&amp;#039;),&lt;br /&gt;
                          &amp;quot;&amp;quot;) ) #Last Name&lt;br /&gt;
      f.flush()&lt;br /&gt;
      f.close()&lt;br /&gt;
&lt;br /&gt;
  if __name__ == &amp;#039;__main__&amp;#039;:&lt;br /&gt;
    #download_applications(CATEGORIES)&lt;br /&gt;
    applications = list_applications(CATEGORIES)&lt;br /&gt;
    #download_content(applications)&lt;br /&gt;
    content = list_content(applications)&lt;br /&gt;
    applications = parse_content(content)&lt;br /&gt;
    write_content(applications)&lt;/div&gt;</summary>
		<author><name>Hub</name></author>
	</entry>
</feed>