<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.boywiki.org/en/index.php?action=history&amp;feed=atom&amp;title=User%3ALysander%2FAllPagesBot.php</id>
	<title>User:Lysander/AllPagesBot.php - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.boywiki.org/en/index.php?action=history&amp;feed=atom&amp;title=User%3ALysander%2FAllPagesBot.php"/>
	<link rel="alternate" type="text/html" href="https://www.boywiki.org/en/index.php?title=User:Lysander/AllPagesBot.php&amp;action=history"/>
	<updated>2026-06-19T10:24:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://www.boywiki.org/en/index.php?title=User:Lysander/AllPagesBot.php&amp;diff=23915&amp;oldid=prev</id>
		<title>Lysander at 21:37, 3 May 2015</title>
		<link rel="alternate" type="text/html" href="https://www.boywiki.org/en/index.php?title=User:Lysander/AllPagesBot.php&amp;diff=23915&amp;oldid=prev"/>
		<updated>2015-05-03T21:37:07Z</updated>

		<summary type="html">&lt;p&gt;&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:37, 3 May 2015&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-l43&quot;&gt;Line 43:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 43:&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;function iterate ( $wiki, $namespaces, $pageTitles ) {&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;function iterate ( $wiki, $namespaces, $pageTitles ) {&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;     foreach ( $namespaces as $namespace ) {&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;     foreach ( $namespaces as $namespace ) {&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;        $spacesBetweenFiveHundredResults = 6;&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;         $done = false;&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;         $done = false;&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;             while ( !$done ) {&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;             while ( !$done ) {&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-l58&quot;&gt;Line 58:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&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;             foreach ( $ret[&amp;#039;query&amp;#039;][&amp;#039;allpages&amp;#039;] as $thisPage ) {&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;             foreach ( $ret[&amp;#039;query&amp;#039;][&amp;#039;allpages&amp;#039;] as $thisPage ) {&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;                 fwrite ( $pageTitles, $thisPage[&amp;#039;title&amp;#039;] . &amp;quot;\n&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;                 fwrite ( $pageTitles, $thisPage[&amp;#039;title&amp;#039;] . &amp;quot;\n&amp;quot; );&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;            $counter = 0;&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;            while ( $counter &amp;lt; $spacesBetweenFiveHundredResults ) {&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;                fwrite ( $pageTitles, &quot;\n&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;                $counter++;&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;             }&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;             }&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;         }&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;         }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lysander</name></author>
	</entry>
	<entry>
		<id>https://www.boywiki.org/en/index.php?title=User:Lysander/AllPagesBot.php&amp;diff=23914&amp;oldid=prev</id>
		<title>Lysander: Created page with &quot;&lt;pre&gt; &lt;?php /* AllPagesBot  * By Leucosticte, https://www.mediawiki.org/wiki/User:Leucosticte  * GNU Public License 2.0  *  * This bot retrieves a list of all files on the wik...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.boywiki.org/en/index.php?title=User:Lysander/AllPagesBot.php&amp;diff=23914&amp;oldid=prev"/>
		<updated>2015-05-03T20:56:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; &amp;lt;?php /* AllPagesBot  * By Leucosticte, https://www.mediawiki.org/wiki/User:Leucosticte  * GNU Public License 2.0  *  * This bot retrieves a list of all files on the wik...&amp;quot;&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;
&amp;lt;?php&lt;br /&gt;
/* AllPagesBot&lt;br /&gt;
 * By Leucosticte, https://www.mediawiki.org/wiki/User:Leucosticte&lt;br /&gt;
 * GNU Public License 2.0&lt;br /&gt;
 *&lt;br /&gt;
 * This bot retrieves a list of all files on the wiki and stores that list in two text files,&lt;br /&gt;
 * one for the File: namespace, and another for all the other namespaces.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* Setup my classes. */&lt;br /&gt;
include( &amp;#039;/home/nathan/Chris-G-botclasses/botclasses.php&amp;#039; );&lt;br /&gt;
$wiki      = new wikipedia;&lt;br /&gt;
#$wiki-&amp;gt;url = &amp;quot;http://en.wikipedia.org/w/api.php&amp;quot;;&lt;br /&gt;
$wiki-&amp;gt;url = &amp;quot;https://mediawiki.org/w/api.php&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
/* All the login stuff. */&lt;br /&gt;
#$user = &amp;#039;REMOVED&amp;#039;;&lt;br /&gt;
#$pass = &amp;#039;REMOVED&amp;#039;;&lt;br /&gt;
#$wiki-&amp;gt;login( $user,$pass );&lt;br /&gt;
&lt;br /&gt;
#$namespaces = range( 0, 15 ); // Default namespaces&lt;br /&gt;
$namespaces = range( 8, 8 );&lt;br /&gt;
// Extra namespaces&lt;br /&gt;
#$namespaces[] = 500;&lt;br /&gt;
#$namespaces[] = 501;&lt;br /&gt;
$namespaces = array_filter( $namespaces, &amp;quot;notFile&amp;quot; ); // Filter out the File: namespace&lt;br /&gt;
&lt;br /&gt;
$pageTitlesFile = &amp;#039;PageTitles.txt&amp;#039;;&lt;br /&gt;
$pageTitlesNs6File = &amp;#039;PageTitlesNs6.txt&amp;#039;;&lt;br /&gt;
$pageTitles = fopen ( $pageTitlesFile, &amp;#039;w&amp;#039; );&lt;br /&gt;
#$pageTitlesNs6 = fopen ( $pageTitlesNs6File, &amp;#039;w&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
iterate ( $wiki, $namespaces, $pageTitles ); // Everything but File: namespace&lt;br /&gt;
#iterate ( $wiki, array ( 6), $pageTitlesNs6 ); // Only the File: namespace&lt;br /&gt;
&lt;br /&gt;
// Filter out the File: namespace&lt;br /&gt;
function notFile ( $var ) {&lt;br /&gt;
    return ( $var != 6 );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Retrieve the data and store it in the file&lt;br /&gt;
function iterate ( $wiki, $namespaces, $pageTitles ) {&lt;br /&gt;
    foreach ( $namespaces as $namespace ) {&lt;br /&gt;
        $done = false;&lt;br /&gt;
            while ( !$done ) {&lt;br /&gt;
            $query = &amp;quot;?action=query&amp;amp;format=php&amp;amp;list=allpages&amp;amp;aplimit=500&amp;amp;apnamespace=$namespace&amp;quot;&lt;br /&gt;
                . &amp;quot;&amp;amp;continue=&amp;quot;;&lt;br /&gt;
            if ( isset( $apcontinue ) ) {&lt;br /&gt;
                $query .= &amp;quot;&amp;amp;apcontinue=$apcontinue&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            $ret = $wiki-&amp;gt;query ( $query );&lt;br /&gt;
            if ( !isset ( $ret[&amp;#039;continue&amp;#039;] ) ) {&lt;br /&gt;
                $done = true;&lt;br /&gt;
            } else {&lt;br /&gt;
                $apcontinue = $ret[&amp;#039;continue&amp;#039;][&amp;#039;apcontinue&amp;#039;];&lt;br /&gt;
            }&lt;br /&gt;
            foreach ( $ret[&amp;#039;query&amp;#039;][&amp;#039;allpages&amp;#039;] as $thisPage ) {&lt;br /&gt;
                fwrite ( $pageTitles, $thisPage[&amp;#039;title&amp;#039;] . &amp;quot;\n&amp;quot; );&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
fclose ( $pageTitles );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lysander</name></author>
	</entry>
</feed>