-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kratta.pl
executable file
·60 lines (45 loc) · 1.89 KB
/
Kratta.pl
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
#!/usr/bin/perl
# Fluffbot restoring templates
# Copyright (C) User:Fluff 2013
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
use lib "/data/project/perfectbot/Fluffbot/perlwikipedia-fluff/lib";
use strict;
use Perlwikipedia;
use Encode;
my $bot = Perlwikipedia->new("fluffbot");
my $debug = 1;
my $filepath = "/data/project/perfectbot/Fluffbot/krattmallar/";
$bot->set_wiki("sv.wikipedia.org", "w");
$bot->{debug} = 0;
open(P, "</data/project/perfectbot/.pwd-Fluffbot") || die("Could not find password");
my $pwd = <P>;
chomp($pwd);
$bot->login("Fluffbot", $pwd);
open(INF, "<$filepath/kratta_sandbox.txt");
my $text = Encode::decode("utf-8", join("", <INF>));
close(INF);
$bot->edit("Wikipedia:Sandl\x{e5}dan", $text, "Krattar sandl\x{e5}dan");
sleep 30;
open(INF, "<$filepath/kratta_hinkenochspaden.txt");
$text = Encode::decode("utf-8", join("", <INF>));
close(INF);
$bot->edit("Mall:Hinken och spaden", $text, "\x{c5}terst\x{e4}ller testmall");
sleep 30;
open(INF, "<$filepath/kratta_spadenochhinken.txt");
$text = Encode::decode("utf-8", join("", <INF>));
close(INF);
$bot->edit("Mall:Spaden och hinken", $text, "\x{c5}terst\x{e4}ller testmall");
sleep 30;
open(INF, "<$filepath/kratta_testmall.txt");
$text = Encode::decode("utf-8", join("", <INF>));
close(INF);
$bot->edit("Mall:Testmall", $text, "\x{c5}terst\x{e4}ller testmall");