Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5371
bug.pl
Public
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:27 PM
2014-11-21 22:27:32 (UTC+0)
Size
523 B
Referenced Files
None
Subscribers
None
bug.pl
View Options
#
!
/
usr
/
bin
/
perl
-
w
use
strict
;
use
WWW
::
Mechanize
;
my
$
mech
=
WWW
::
Mechanize
->
new
(
agent=>'bug test'
);
my
$
url
=
'http://en.wikipedia.org/w/index.php?title=Special:Export'
;
sub
export
(
$
;
$
)
{
my
$
url
=
shift
;
my
$
pagelist
=
shift
;
my
%fields = (templates=>1, curonly=>1, pages=>$pagelist);
$
mech->
get
(
$
url
);
$
mech->
submit_form
(
with_fields=>
\
%fields);
if
(
$
mech->
content
()
=~
/^<mediawiki
/
)
{
print
$
mech->
content
();
}
else
{
warn
"Bogus content"
;
}
}
export
(
$
url
,
'Main_Page'
);
File Metadata
Details
Attached
Mime Type
text/x-perl
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4931
Default Alt Text
bug.pl (523 B)
Attached To
Mode
T19374: special:export exports two copies of pages
Attached
Detach File
Event Timeline
Log In to Comment