Perlwikipedia

 view release on metacpan or  search on metacpan

RELEASE-NOTES  view on Meta::CPAN

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
                        * Maxlag parameter: Dafault 5 seconds, can be configured when creating the object
                        * Delay: 1 second
                        * Retries: Until success
                * Make test 98 fail gracefully on platforms without the test suite
                * Fix some really weird spacing in the Makefile.PL
        Notes:
                * The other maxlag options, along with lots of other defaults, will probably be modifiable in 1.4 with a sort of config sub. This will allow the custom configuration of options for WWW::Mechanize and MediaWiki::API, so you don't need to go sourcedi...
                * Since wiki.xyrael.net is down, tests 1, 8, 10, 11
1.3.5 DCOLLINS October 4 2008
        Changes made since 1.3.4:
                * Allowing cascade protection now. This may or may not work, since there are some changes being made to the protection API.
                * Anonymous editing should work. If you still can not use this framework to edit, I need to be contacted. To this end, I've enabled an editing test, hopefully cpan-testers sends me good results :)
                * Fix a stupid mistake I made regarding the names of certain parameters to get_history
1.3.4 DCOLLINS September 11 2008
        Changes made since 1.3.3:
                * Some triage after the first CPAN test results came in:
                * Appearantly, get_pages_in_category was running test file 08, test 2, very slowly because I was loading a 1000+ page category in sets of 10 pages at a time. This has been remedied, the limit is now 500.
                * Cannot reproduce a bug in get_namespace_names and another in count_contributions - so instead, if we get weird results, we run the sub again.
                * There is a bug in get_history which was causing weird errors on some test machines. I've switched it to use MediaWiki::API.
1.3.3 DCOLLINS September 10 2008
        Changes made since 1.3.2:

lib/Perlwikipedia.pm  view on Meta::CPAN

852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
                reason=>$summary };
        $hash->{anononly}=$anononly if ($anononly);
        $hash->{autoblock}=$autoblock if ($autoblock);
        $hash->{nocreate}=$blockac if ($blockac);
        $hash->{noemail}=$blockemail if ($blockemail);
        $res = $self->{api}->api( $hash );
 
        return $res;
}
 
=item protect($page, $reason, $editlvl, $movelvl, $time, $cascade)
 
Protects (or unprotects) the page. $editlvl and $movelvl may be '', 'autoconfirmed', or 'sysop'. $cascade is true/false.
 
=cut
 
sub protect {
        my $self        = shift;
        my $page        = shift;
        my $reason      = shift;
        my $editlvl     = shift || 'all';
        my $movelvl     = shift || 'all';
        my $time        = shift || 'infinite';
        my $cascade     = shift;
         
        if ($cascade and ($editlvl ne 'sysop' or $movelvl ne 'sysop')) {
                carp "Can't set cascading unless both editlvl and movelvl are sysop."
        }
        my $res = $self->{api}->api( {
                action=>'query',
                titles=>$page,
                prop=>'info|revisions',
                intoken=>'protect' } );
#use Data::Dumper;print STDERR Dumper($res);
        my ($id, $data)=%{$res->{query}->{pages}};
        my $edittoken=$data->{protecttoken};
        my $hash={      action=>'protect',
                title=>$page,
                token=>$edittoken,
                reason=>$reason,
                protections=>"edit=$editlvl|move=$movelvl",
                expiry=>$time };
        $hash->{'cascade'}=$cascade if ($cascade);
        $res = $self->{api}->api( $hash );
 
        return $res;
}
 
=item get_pages_in_namespace($namespace_id,$page_limit)
 
Returns an array containing the names of all pages in the specified namespace. The $namespace_id must be a number, not a namespace name. Setting $page_limit is optional. If $page_limit is over 500, it will be rounded up to the next multiple of 500.
 
=cut



( run in 0.379 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )