<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/index.php?action=history&amp;feed=atom&amp;title=User%3AGrabberBot%2Fposter.py</id>
	<title>User:GrabberBot/poster.py - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/index.php?action=history&amp;feed=atom&amp;title=User%3AGrabberBot%2Fposter.py"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=User:GrabberBot/poster.py&amp;action=history"/>
	<updated>2026-04-22T09:37:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=User:GrabberBot/poster.py&amp;diff=4388&amp;oldid=prev</id>
		<title>Allefant at 13:22, 1 November 2005</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=User:GrabberBot/poster.py&amp;diff=4388&amp;oldid=prev"/>
		<updated>2005-11-01T13:22:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:22, 1 November 2005&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-l29&quot; &gt;Line 29:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 29:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;#160;&amp;#160; &amp;#160; data = &amp;quot;&amp;quot;&amp;quot;\&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;#160;&amp;#160; &amp;#160; data = &amp;quot;&amp;quot;&amp;quot;\&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;This list is generated by a bot, and contains links to plain image attachements&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;This list is generated by a bot, and contains links to plain image attachements&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;which were posted to the forums recently. The bot &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;can be found &lt;/del&gt;here:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;which were posted to the forums recently. The bot &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;is &lt;/ins&gt;here: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[User:GrabberBot]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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 class=&quot;diffchange diffchange-inline&quot;&gt;http://www.wesnoth.org/forum/viewtopic.php?t=6078 &lt;/del&gt;The idea is to make it easier&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;The idea is to make it easier to keep the [[GraphicLibrary]] updated with new graphics, if not, I'll just&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;to keep the [[GraphicLibrary]] updated with new graphics, if not, I'll just&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;remove it from my crontab again :)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;remove it from my crontab again :)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot; &gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;image, click the '''X'''. The effect won't be immediate, it merely will schedule&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;image, click the '''X'''. The effect won't be immediate, it merely will schedule&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;the command on a site I'm mis-using for this (so if you have a machine where you&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;the command on a site I'm mis-using for this (so if you have a machine where you&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;can run the python script, by all means, let me know). For now, when my computer&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;can run the python script &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;once a day or so&lt;/ins&gt;, by all means, let me know). For now, when my computer&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;is switched on the next time, the script will be run and it will read all the&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;is switched on the next time, the script will be run and it will read all the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;scheduled commands and update the links.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;scheduled commands and update the links.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Allefant</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=User:GrabberBot/poster.py&amp;diff=1999&amp;oldid=prev</id>
		<title>Allefant: pasted code</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=User:GrabberBot/poster.py&amp;diff=1999&amp;oldid=prev"/>
		<updated>2005-08-19T20:23:43Z</updated>

		<summary type="html">&lt;p&gt;pasted code&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/python&lt;br /&gt;
&lt;br /&gt;
import sys, re, os&lt;br /&gt;
import mediawiki&lt;br /&gt;
&lt;br /&gt;
url = &amp;quot;UnsortedContrib&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# read data to post&lt;br /&gt;
try:&lt;br /&gt;
    post = file(&amp;quot;post.txt&amp;quot;, &amp;quot;r&amp;quot;).read().strip()&lt;br /&gt;
except IOError:&lt;br /&gt;
    sys.exit(0)&lt;br /&gt;
&lt;br /&gt;
if post == &amp;quot;&amp;quot;:&lt;br /&gt;
    sys.exit(0)&lt;br /&gt;
&lt;br /&gt;
# open wiki page for editing, read current contents&lt;br /&gt;
mw = mediawiki.MediaWiki()&lt;br /&gt;
data = mw.fetch(url)&lt;br /&gt;
&lt;br /&gt;
# find part of page to replace&lt;br /&gt;
mob = re.compile(&amp;quot;== Recently posted images ==(.*)== See Also ==&amp;quot;,&lt;br /&gt;
    re.S).search(data)&lt;br /&gt;
if mob:&lt;br /&gt;
    images = mob.group(1).strip()&lt;br /&gt;
    data = data[:mob.start(1)] + &amp;quot;\n\n&amp;quot; + images + &amp;quot;\n&amp;quot; + post + &amp;quot;\n\n&amp;quot; + data[mob.end(1):]&lt;br /&gt;
else:&lt;br /&gt;
    data = &amp;quot;&amp;quot;&amp;quot;\&lt;br /&gt;
This list is generated by a bot, and contains links to plain image attachements&lt;br /&gt;
which were posted to the forums recently. The bot can be found here:&lt;br /&gt;
http://www.wesnoth.org/forum/viewtopic.php?t=6078 The idea is to make it easier&lt;br /&gt;
to keep the [[GraphicLibrary]] updated with new graphics, if not, I'll just&lt;br /&gt;
remove it from my crontab again :)&lt;br /&gt;
&lt;br /&gt;
You are encouraged to remove images which don't fit (e.g. screenshots, concept&lt;br /&gt;
art, off-topic images), and move proper unit graphics over to the&lt;br /&gt;
[[GraphicLibrary]]. To move an image, click on the '''Move''' link. To delete an&lt;br /&gt;
image, click the '''X'''. The effect won't be immediate, it merely will schedule&lt;br /&gt;
the command on a site I'm mis-using for this (so if you have a machine where you&lt;br /&gt;
can run the python script, by all means, let me know). For now, when my computer&lt;br /&gt;
is switched on the next time, the script will be run and it will read all the&lt;br /&gt;
scheduled commands and update the links.&lt;br /&gt;
&lt;br /&gt;
== Recently posted images ==&lt;br /&gt;
&lt;br /&gt;
%s&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[GraphicLibrary]]&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot; % post&lt;br /&gt;
&lt;br /&gt;
# post to the wiki&lt;br /&gt;
n = len(post.splitlines())&lt;br /&gt;
s = &amp;quot;s&amp;quot;&lt;br /&gt;
if n == 1: s = &amp;quot;&amp;quot;&lt;br /&gt;
mw.post(url, data, &amp;quot;added %d new forum image%s&amp;quot; % (n, s))&lt;br /&gt;
&lt;br /&gt;
os.remove(&amp;quot;post.txt&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Allefant</name></author>
		
	</entry>
</feed>