Talk:Wiki.pl
- Todo
- RSS and general URL matching notworking proeprly, probably cos all going into 00:00 time... things are showing up in the cache files but not appearing in the changes. --Nad 11:55, 8 Oct 2006 (NZST)
- Modifications to work with MediaWiki 1.6.5
I've installed the latest MediaWiki on a site at the Uni and was using some of your automated wikiLogon, wikiEdit code. I discovered that they have changed the login form slightly and the regexp provided in this article did not work. So here is the modified line of code that I have tested and it works. I'm not sure how best to integrate this. I have a feeling the regexp could be generalised to deal with both cases. I was tripped up by the forward matching style of the source HTML where the value comes before the key, but making the last bit greedy fixed it, providing the Token is the last thing in the form we want to grab.
/^<input type='hidden' value="(.*?)" name="wpSection".+?value="(\d*?)" name="wpEdittime".+<input type='hidden' value="(.*?)" name="wpEditToken"/sm
--Rob 14:00, 15 May 2006 (NZST)
See also
- Yi-bot
- Csv2wiki.pl
- Wikipedia:Bot policy
- Wikipedia:Creating a bot
- CPAN WWW-Mediawiki-Client
- Using the python wikipediabot
Examples
Edit
Delete
Querying categories
The code to fetch a bullet list doesn't appear to be available in the form of a function. The query string can be used here to fetch most of the content efficiently. e.g. Using the MW:Manual:Parameters_to_index.php action=render argument in the query sting returns a small amount of structured html in the for of a bullet list. Unfortunately content from the summary itself is also present, so the last bullet list of content is most relevant for parsing.
For example http://www.organicdesign.co.nz/wiki/index.php?title=Category:Nad/Todo&action=render will output a bullet list wrapped in html.
In the Mediawiki MW:API, there is an [ http://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Physics&cmlimit=30 example] query to fetch category content . The maximum number of members that can be fetched is 500 for humans and 5000 for bots. This is documented within http://en.wikipedia.org/w/api.php. --Sven 16:26, 11 June 2008 (NZST)
Debugging
Output the form content and run the perl oneliner on it
Redirecting output to info.php is also useful to compare header and post request information automated
--Sven 22:07, 17 June 2008 (NZST)



