This repository was archived by the owner on Jan 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeta-archive-createarchivepages.php
executable file
·160 lines (110 loc) · 4.12 KB
/
meta-archive-createarchivepages.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?php
/* ---------------------------------------------
Author : Quentinv57 (2011 - 2014)
Steinsplitter (2014 - )
Licence : GNU General Public License v3
(see http://www.gnu.org/licenses/)
Date of creation : 2011-04
Meta Archival Script - creates all archive pages
--------------------------------------------- */
function createpage ($pn, $text)
# fct intermédiaire pour rendre le code plus lisible
{
global $site;
$reason = 'init archive';
echo "Creating [[$pn]]";
$site->initPage( $pn )->edit( $text, $reason );
echo "...\n";
sleep(5);
}
//Dependency: https://github.com/MW-Peachy/Peachy
require( '/data/project/sbot/Peachy/Peachy/Init.php' );
$site = Peachy::newWiki( "meta" );
$site->set_runpage( null );
$array_feed = array(
'Talk:Spam blacklist/Archives/' => "{{Archive header}}
== Proposed additions ==
{| style=\"border:1px solid #AAA; background:#f9f9f9; width:100%; margin:0 auto 1em auto; padding:.2em; text-align:justify;\"
|style=\"width:50px;\"|[[File:Symbol comment vote.svg|50px]]
|style=\"padding-left:.2em;\"|This section is for completed requests that a website be blacklisted
|}
== Proposed removals ==
{| style=\"border:1px solid #AAA; background:#f9f9f9; width:100%; margin:0 auto 1em auto; padding:.2em; text-align:justify;\"
|style=\"width:50px;\"|[[File:Symbol comment vote.svg|50px]]
|style=\"padding-left:.2em;\"|This section is for archiving proposals that a website be ''un''listed.
|}
== Troubleshooting and problems ==
{| style=\"border:1px solid #AAA; background:#f9f9f9; width:100%; margin:0 auto 1em auto; padding:.2em; text-align:justify;\"
|style=\"width:50px;\"|[[File:Symbol comment vote.svg|50px]]
|style=\"padding-left:.2em;\"|This section is for archiving Troubleshooting and problems.
|}
== Discussion ==
{| style=\"border:1px solid #AAA; background:#f9f9f9; width:100%; margin:0 auto 1em auto; padding:.2em; text-align:justify;\"
|style=\"width:50px;\"|[[File:Symbol comment vote.svg|50px]]
|style=\"padding-left:.2em;\"|This section is for archiving Discussions.
|}
",
'Steward requests/Checkuser/' => "__NOINDEX__
{{archive header}}
[[Category:Steward requests archive/Checkuser]]
== Requests ==
",
'Steward requests/Global/' => "{{archive header}}{{NOINDEX}}
[[Category:Steward requests archive/Global]]
== Requests for global (un)block ==
== Requests for global (un)lock and (un)hiding ==
",
'Steward requests/Global permissions/' => "__NOINDEX__
{{archive header}}
[[Category:Steward requests archive/Global permissions]]
== Requests for global rollback permissions ==
== Requests for global sysop permissions ==
== Requests for global IP block exemption ==
== Requests for global rename permissions ==
== Requests for other global permissions ==
",
'Steward requests/Bot status/' => "__NOINDEX__
{{archive-header}}
[[Category:Steward requests archive/Bot status]]
== Global bot status requests ==
== Removal of global bot status ==
== Bot status requests ==
== Removal of bot status ==
",
'Steward requests/Miscellaneous/' => "__NOINDEX__
{{archive-header}}
== Manual requests ==
",
'Steward requests/Permissions/' => "__NOINDEX__
{{archive header}}
[[Category:Steward requests archive/Permissions]]
== Administrator access ==
== Bureaucrat access ==
== CheckUser access ==
== Oversight access ==
== Removal of access ==
== Temporary permissions (expired and rejected requests only) ==
== Miscellaneous requests ==
",
'Steward requests/Username changes/' => "__NOINDEX__
{{archive header}}
[[Category:Steward requests archive/Username changes]]
== Simple rename requests ==
== Requests involving merges, usurps or other complications ==
"
);
if (date('m')!=12) $sfx = date('Y') . '-' . str_pad((date('m')+1), 2, 0, STR_PAD_LEFT) ;
else $sfx = (date('Y')+1) . '-' . '01';
foreach($array_feed as $pn => $text)
{
global $site;
$pn .= $sfx ;
$esum = "" ;
$es = $site->initPage( $pn );
if( !($es->get_exists()) )
{
$site->initPage( $pn )->edit( $text, $reason );
}
else echo "Skipping [[$pn]] (already created)\n";
}
?>