User talk:KeithTyler/mwpush.pl

Latest comment: 13 years ago by Karthik.raman in topic Posting to Index.php page?

Thanks for the code. :) --Oblivious 11:03, 30 October 2005 (UTC)Reply

Edit conflict edit

I am able to use this code to push files from a linux box to a wiki server in my intranet. It works fine when pushing data to a non-existent page. Subsequent submissions to any page (created by this script) works fine. However, when I try to insert data to page created by any user, I get "edit conflict" message (in mwpush.log) help? --Oblivious 15:08, 31 October 2005 (UTC)Reply

Thanks for the fix Keith (or Tyler?). It works :) --Oblivious 20:48, 31 October 2005 (UTC)Reply
Had to make an update to the script so that it would recreate pages that were previously deleted by someone else.
--- mwpush.pl.orig      2006-05-17 15:14:37.000000000 -0400
+++ mwpush.pl   2006-05-17 15:15:29.000000000 -0400
@@ -125,6 +125,7 @@
           wpSummary => "Automated page entry using MWPush.pl",
           wpSave => "Save page",
           wpSection => "",
+          wpStarttime => $editTime,
           wpEdittime => $editTime,
           wpEditToken => $editToken,
         ]);

-- Calvin Smith May 17 15:46:40 EDT 2006

Wonderful Script edit

I found your script while creating historical NCAA brackets (see 1955 NCAA Men's Division I Basketball Tournament), and it's saved me huge amounts of effort. Thank you! A few points, though: you should make it clearer that the wiki URL passed in on the command line needs to be "en.wikipedia.org/w", not just "www.wikipedia.org" or "en.wikipedia.org". The logs files made it easy enough to figure out, but it would have been nice to have the documentation. Also, I added a parameter to pass in a custom edit summary if you're interested. --Dantheox 19:37, 13 March 2006 (UTC)Reply

Additions edit

Hey all, by adding this code to WP it automatically became GFDL. So if you have general purpose enhancements to make, please feel free to make them on the article page.

On the other hand, if you have specific-purpose adaptations, that should probably be a new script with a new page.

- Keith D. Tyler (AMA) 23:29, 17 May 2006 (UTC)Reply

wpLoginToken edit

I am not sure since when, but it looks like the script is not able to login without sending the hidden form value in "wpLoginToken". Following modification would fix this the login fails for some reason. Following modification fixes it.

$browser->cookie_jar( {} );

+ $response=$browser->post("http://".$WIKI_PATH."/index.php?title=Special:Userlogin",@ns_headers);
+ $response->content =~ m/name="wpLoginToken"\s+value="([^"]+)"/ ;
+ my $token = $1 ;

# Make login request
- $response=$browser->post("http://".$WIKI_PATH."/index.php?title=Special:UserLogin&action=submitlogin",
- @ns_headers, Content=>[wpName=>$username,wpPassword=>$password,wpRemember=>"1",wpLoginAttempt=>"Log in"]);

+ $response=$browser->post("http://".$WIKI_PATH."/index.php?title=Special:UserLogin&action=submitlogin",
+ @ns_headers, Content=>[wpName=>$username,wpPassword=>$password,wpRemember=>"1",wpLoginAttempt=>"Log in",wpLoginToken=>$token]);

--Oblivious 06:37, 11 November 2010 (UTC) —Preceding unsigned comment added by 124.195.194.2 (talk) Reply

Posting to Index.php page? edit

I have used MWpush.pl effectively before, but presently it is writing any page I send to "Index.php" on the wiki. Is there an obvious mistake I am committing? I hope it's acceptable to post this here, because there may be other users facing this problem. I haven't upgraded my mediawiki since the last time I used MWpush successfully.

-Karthik.raman (talk) 13:24, 1 March 2011 (UTC)Reply