User:AnomieBOT/source/tasks/WikiProjectWorker.pm

This is an old revision of this page, as edited by AnomieBOT (talk | contribs) at 22:38, 14 September 2014 (Updating published sources: WikiProjectWorker: * Run is complete.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
package tasks::WikiProjectWorker;

=pod

=begin metadata

Bot:      AnomieBOT
Task:     WikiProjectWorker
BRFA:     Wikipedia:Bots/Requests for approval/AnomieBOT 28
Status:   Approved 2009-04-08
Created:  2009-03-27
OnDemand: true

Perform various tasks at the request of the affected WikiProjects:
* Add or remove banners on a specific set of pages (e.g. pages in a category, pages transcluding a template).
* Adjust banner parameters, particularly assessments and task forces.
* Fix banner shells on pages edited for the above reasons.

=end metadata

=cut

use utf8;
use strict;

use Data::Dumper;
use AnomieBOT::Task;
use vars qw/@ISA/;
@ISA=qw/AnomieBOT::Task/;

### Request link, for edit summary.
my $req="[[User:AnomieBOT/req/WikiProject Women writers 1|request]]";

### Increment this number every time a new run is started, so we don't have to
### mess around with deleting previous runs' database entries.
my $seq=21;

### How to find the pages?
my @cats=(
    'Category:10th-century women writers',
    'Category:11th-century women writers',
    'Category:12th-century women writers',
    'Category:13th-century women writers',
    'Category:14th-century women writers',
    'Category:15th-century women writers',
    'Category:16th-century women writers',
    'Category:17th-century women writers',
    'Category:18th-century women writers',
    'Category:19th-century women writers',
    'Category:1st-century BC women writers',
    'Category:1st-century women writers',
    'Category:20th-century women writers',
    'Category:21st-century women writers',
    'Category:23rd-century BC women writers',
    'Category:2nd-century BC women writers',
    'Category:2nd-century women writers',
    'Category:3rd-century BC women writers',
    'Category:3rd-century women writers',
    'Category:4th-century BC women writers',
    'Category:4th-century women writers',
    'Category:5th-century BC women writers',
    'Category:5th-century women writers',
    'Category:6th-century BC women writers',
    'Category:6th-century women writers',
    'Category:7th-century women writers',
    'Category:8th-century women writers',
    'Category:9th-century women writers',
    'Category:Afghan women writers',
    'Category:African-American women writers',
    'Category:Agatha Raisin series',
    'Category:Albanian women novelists',
    'Category:Albanian women writers',
    'Category:Algerian women novelists',
    'Category:Algerian women writers',
    'Category:Amelia Peabody',
    'Category:American women dramatists and playwrights',
    'Category:American women journalists',
    'Category:American women novelists',
    'Category:American women poets',
    'Category:American women screenwriters',
    'Category:American women short story writers',
    'Category:American women sportswriters',
    'Category:American women writers',
    'Category:Ancient Asian women writers',
    'Category:Ancient Greek women poets',
    'Category:Ancient Greek women writers',
    'Category:Ancient Roman women writers',
    'Category:Ancient Spartan women poets',
    'Category:Ancient women poets',
    'Category:Anglo-Irish women poets',
    'Category:Anglo-Welsh women poets',
    'Category:Anita Blake: Vampire Hunter novels',
    'Category:Anne of Green Gables books',
    'Category:Antigua and Barbuda women writers',
    'Category:Arabic-language women poets',
    'Category:Argentine women journalists',
    'Category:Argentine women novelists',
    'Category:Argentine women poets',
    'Category:Argentine women writers',
    'Category:Australian women journalists',
    'Category:Australian women novelists',
    'Category:Australian women poets',
    'Category:Australian women writers',
    'Category:Austrian women novelists',
    'Category:Austrian women poets',
    'Category:Austrian women writers',
    'Category:Azerbaijani-language women poets',
    'Category:Azerbaijani women poets',
    'Category:Azerbaijani women writers',
    'Category:Bangladeshi women novelists',
    'Category:Bangladeshi women writers',
    'Category:Belgian women novelists',
    'Category:Belgian women writers',
    'Category:Belizean women writers',
    'Category:Beninese women poets',
    'Category:Beninese women writers',
    'Category:Biographical dictionaries of women writers',
    'Category:Books by Agatha Christie',
    'Category:Books by Alice Walker',
    'Category:Books by Ayn Rand',
    'Category:Books by Barbara Kingsolver',
    'Category:Books by Baroness Emma Orczy',
    'Category:Books by Carmel Buckingham',
    'Category:Books by Celeste Buckingham',
    'Category:Books by Chimamanda Ngozi Adichie',
    'Category:Books by Dorothy L. Sayers',
    'Category:Books by Ellen G. White',
    'Category:Books by Enid Blyton',
    'Category:Books by Gertrude Stein',
    'Category:Books by Helen Garner',
    'Category:Books by Jessica Lange',
    'Category:Books by Joan Didion',
    'Category:Books by Judy Blume',
    'Category:Books by Kaari Utrio',
    'Category:Books by Laura Trenter',
    'Category:Books by Lucy Maud Montgomery',
    'Category:Books by Madonna (entertainer)',
    'Category:Books by Maeve Binchy',
    'Category:Books by Margaret Atwood',
    'Category:Books by Mary McCarthy',
    'Category:Books by Mary Wollstonecraft',
    'Category:Books by Nadine Gordimer',
    'Category:Books by Patti Smith',
    'Category:Books by P. D. James',
    'Category:Books by Poppy Z. Brite',
    'Category:Books by Ruth Park',
    'Category:Books by Ruth Rendell',
    'Category:Books by Sandra Cisneros',
    'Category:Books by Simone de Beauvoir',
    'Category:Books by Sylvia Plath',
    'Category:Books by Virginia Woolf',
    'Category:Bosnia and Herzegovina women writers',
    'Category:Brazilian women writers',
    'Category:British women dramatists and playwrights',
    'Category:British women journalists',
    'Category:British women novelists',
    'Category:British women poets',
    'Category:British women writers',
    'Category:Bulgarian women writers',
    'Category:Burkinabé women writers',
    'Category:Burmese women writers',
    'Category:Byzantine women writers',
    'Category:Cameroonian women writers',
    'Category:Canadian women dramatists and playwrights',
    'Category:Canadian women journalists',
    'Category:Canadian women novelists',
    'Category:Canadian women poets',
    'Category:Canadian women sportswriters',
    'Category:Canadian women writers',
    'Category:Caribbean women writers',
    'Category:Catalan women writers',
    'Category:Chilean women writers',
    'Category:Chinese women poets',
    'Category:Chinese women writers',
    'Category:Colombian women journalists',
    'Category:Colombian women writers',
    'Category:Costa Rican women writers',
    'Category:Croatian women writers',
    'Category:Cuban women novelists',
    'Category:Cuban women writers',
    'Category:Czechoslovak women novelists',
    'Category:Czech women writers',
    'Category:Danish women journalists',
    'Category:Danish women novelists',
    'Category:Danish women poets',
    'Category:Danish women writers',
    'Category:Democratic Republic of the Congo women writers',
    'Category:Den of Shadows',
    'Category:Dominican Republic women writers',
    'Category:Dragon Prince series',
    'Category:Dutch women novelists',
    'Category:Dutch women poets',
    'Category:Dutch women writers',
    'Category:Earth\'s Children',
    'Category:Earthsea books',
    'Category:Earthsea novels',
    'Category:Earthsea short stories',
    'Category:Egyptian women journalists',
    'Category:Egyptian women writers',
    'Category:Emelanese books',
    'Category:English women dramatists and playwrights',
    'Category:English women journalists',
    'Category:English women novelists',
    'Category:English women poets',
    'Category:English women writers',
    'Category:Enid Blyton series',
    'Category:Essay collections by Barbara Kingsolver',
    'Category:Essay collections by Joan Didion',
    'Category:Essays by Simone de Beauvoir',
    'Category:Estonian women writers',
    'Category:Fantasy novels by C. J. Cherryh',
    'Category:Faroese women novelists',
    'Category:Faroese women writers',
    'Category:Federated States of Micronesia women poets',
    'Category:Federated States of Micronesia women writers',
    'Category:Female comics writers',
    'Category:Filipino women novelists',
    'Category:Filipino women writers',
    'Category:Finnish women novelists',
    'Category:Finnish women writers',
    'Category:Firebird book series',
    'Category:French women dramatists and playwrights',
    'Category:French women journalists',
    'Category:French women novelists',
    'Category:French women poets',
    'Category:French women writers',
    'Category:Fudge series',
    'Category:Gemma Doyle Trilogy',
    'Category:German women dramatists and playwrights',
    'Category:German women journalists',
    'Category:German women novelists',
    'Category:German women poets',
    'Category:German women writers',
    'Category:Ghanaian women novelists',
    'Category:Ghanaian women writers',
    'Category:Greek women novelists',
    'Category:Greek women poets',
    'Category:Greek women writers',
    'Category:Guinean women writers',
    'Category:Guyanese women novelists',
    'Category:Guyanese women writers',
    'Category:Haitian women novelists',
    'Category:Haitian women writers',
    'Category:Hamish Macbeth series',
    'Category:Hercule Poirot books',
    'Category:Hercule Poirot novels',
    'Category:Hercule Poirot short story collections',
    'Category:Hispanic and Latino American female journalists',
    'Category:Hong Kong women writers',
    'Category:Hungarian women writers',
    'Category:Icelandic women writers',
    'Category:Imperial Russian women writers',
    'Category:In Death (novel series)',
    'Category:Indian women journalists',
    'Category:Indian women novelists',
    'Category:Indian women poets',
    'Category:Indian women writers',
    'Category:Indonesian women novelists',
    'Category:Indonesian women writers',
    'Category:Indonesia women novelists',
    'Category:Inspector Barnaby series',
    'Category:Iranian women journalists',
    'Category:Iranian women novelists',
    'Category:Iranian women writers',
    'Category:Iraqi women poets',
    'Category:Iraqi women writers',
    'Category:Irish women dramatists and playwrights',
    'Category:Irish women journalists',
    'Category:Irish women novelists',
    'Category:Irish women poets',
    'Category:Irish women writers',
    'Category:Israeli women journalists',
    'Category:Israeli women poets',
    'Category:Israeli women writers',
    'Category:Italian women novelists',
    'Category:Italian women poets',
    'Category:Italian women writers',
    'Category:Ivorian women novelists',
    'Category:Ivorian women writers',
    'Category:Jamaican women writers',
    'Category:Japanese women journalists',
    'Category:Japanese women novelists',
    'Category:Japanese women poets',
    'Category:Japanese women writers',
    'Category:Jewish women writers',
    'Category:Kate Martinelli (novel series)',
    'Category:Kenyan women writers',
    'Category:Korean women writers',
    'Category:Lais of Marie de France',
    'Category:Latvian women novelists',
    'Category:Latvian women poets',
    'Category:Latvian women writers',
    'Category:Lebanese women journalists',
    'Category:Lebanese women poets',
    'Category:Lebanese women writers',
    'Category:Lesbian writers',
    'Category:Lists of women writers',
    'Category:Literary awards honoring women',
    'Category:Literature by African-American women',
    'Category:Literature by Asian-American women',
    'Category:Literature by Hispanic and Latino American women',
    'Category:Literature by Native American women',
    'Category:Literature by women',
    'Category:Lithuanian women novelists',
    'Category:Lithuanian women writers',
    'Category:Lois Lowry Giver series',
    'Category:Mabinogion Tetralogy',
    'Category:Malaysian women writers',
    'Category:Maldivian women writers',
    'Category:Malian women novelists',
    'Category:Malian women writers',
    'Category:Mark of the Lion Series',
    'Category:Mary Russell (book series)',
    'Category:Medieval women poets',
    'Category:Merry Gentry (series)',
    'Category:Mexican women dramatists and playwrights',
    'Category:Mexican women journalists',
    'Category:Mexican women novelists',
    'Category:Mexican women poets',
    'Category:Mexican women writers',
    'Category:Midsomer Murders',
    'Category:Miss Marple books',
    'Category:Miss Marple novels',
    'Category:Miss Marple short story collections',
    'Category:Modernist women writers',
    'Category:Moroccan women novelists',
    'Category:Moroccan women writers',
    'Category:Native American women writers',
    'Category:Nepalese women writers',
    'Category:New Zealand women novelists',
    'Category:New Zealand women poets',
    'Category:New Zealand women writers',
    'Category:Nicaraguan women writers',
    'Category:Nigerian women novelists',
    'Category:Nigerian women poets',
    'Category:Nigerian women writers',
    'Category:Nightrunner series',
    'Category:Non-fiction works by Elizabeth Gaskell',
    'Category:Norwegian women writers',
    'Category:Novels by Adeline Yen Mah',
    'Category:Novels by Agate Nesaule',
    'Category:Novels by Agatha Christie',
    'Category:Novels by Alice Walker',
    'Category:Novels by Ally Carter',
    'Category:Novels by Amanda Filipacchi',
    'Category:Novels by Amelia Atwater-Rhodes',
    'Category:Novels by Amy Tan',
    'Category:Novels by Amy Thomson',
    'Category:Novels by Anchee Min',
    'Category:Novels by Anita Desai',
    'Category:Novels by Anita Loos',
    'Category:Novels by Ann Bannon',
    'Category:Novels by Ann Beattie',
    'Category:Novels by Ann C. Crispin',
    'Category:Novels by Anne Brontë',
    'Category:Novels by Anne Rice',
    'Category:Novels by Ann-Marie MacDonald',
    'Category:Novels by Ann Petry',
    'Category:Novels by Ann Rinaldi',
    'Category:Novels by Anya Seton',
    'Category:Novels by Anzia Yezierska',
    'Category:Novels by Aphra Behn',
    'Category:Novels by Astrid Lindgren',
    'Category:Novels by Audre Lorde',
    'Category:Novels by Barbara Hambly',
    'Category:Novels by Barbara Kingsolver',
    'Category:Novels by Baroness Emma Orczy',
    'Category:Novels by Bertha Runkle',
    'Category:Novels by Beverly Cleary',
    'Category:Novels by Bharati Mukherjee',
    'Category:Novels by Carol Higgins Clark',
    'Category:Novels by Caroline Graham',
    'Category:Novels by Caroline Lawrence',
    'Category:Novels by Catherine Asaro',
    'Category:Novels by Catherynne M. Valente',
    'Category:Novels by Cecelia Ahern',
    'Category:Novels by Cecily von Ziegesar',
    'Category:Novels by Charlaine Harris',
    'Category:Novels by Charlotte Brontë',
    'Category:Novels by Chimamanda Ngozi Adichie',
    'Category:Novels by Chitra Banerjee Divakaruni',
    'Category:Novels by Christine Feehan',
    'Category:Novels by C. J. Cherryh',
    'Category:Novels by Clare B. Dunkle',
    'Category:Novels by Connie Willis',
    'Category:Novels by Cristina García',
    'Category:Novels by Danielle Steel',
    'Category:Novels by Daphne du Maurier',
    'Category:Novels by D. C. Fontana',
    'Category:Novels by Diane Carey',
    'Category:Novels by Diane Duane',
    'Category:Novels by Donna Leon',
    'Category:Novels by Doris Lessing',
    'Category:Novels by Dorothy L. Sayers',
    'Category:Novels by Edith Pargeter',
    'Category:Novels by Edith Wharton',
    'Category:Novels by Edna O\'Brien',
    'Category:Novels by Eileen Chang',
    'Category:Novels by Eileen Wilks',
    'Category:Novels by Elaine Cunningham',
    'Category:Novels by Eleanor Arnason',
    'Category:Novels by Elizabeth Gaskell',
    'Category:Novels by Elizabeth Hand',
    'Category:Novels by Elizabeth Kostova',
    'Category:Novels by Elizabeth Peters',
    'Category:Novels by Ellen Hopkins',
    'Category:Novels by E. Nesbit',
    'Category:Novels by Enid Blyton',
    'Category:Novels by Eudora Welty',
    'Category:Novels by Evangeline Walton',
    'Category:Novels by Flannery O\'Connor',
    'Category:Novels by Francesca Lia Block',
    'Category:Novels by Frances Hodgson Burnett',
    'Category:Novels by Francine Rivers',
    'Category:Novels by Gail Carriger',
    'Category:Novels by Gertrude Stein',
    'Category:Novels by Gloria D. Miklowitz',
    'Category:Novels by Gypsy Rose Lee',
    'Category:Novels by Harper Lee',
    'Category:Novels by Harriet Beecher Stowe',
    'Category:Novels by Helen Garner',
    'Category:Novels by Iris Murdoch',
    'Category:Novels by Isabelle Holland',
    'Category:Novels by Jacqueline Susann',
    'Category:Novels by Jacqueline Wilson',
    'Category:Novels by Jacquelyn Mitchard',
    'Category:Novels by Jane Austen',
    'Category:Novels by Janet Morris',
    'Category:Novels by Janet Tashjian',
    'Category:Novels by Jane Yolen',
    'Category:Novels by Jan Karon',
    'Category:Novels by J. C. Greenburg',
    'Category:Novels by Jean M. Auel',
    'Category:Novels by Jessica Amanda Salmonson',
    'Category:Novels by Jessica Hagedorn',
    'Category:Novels by Jhumpa Lahiri',
    'Category:Novels by Joan Didion',
    'Category:Novels by Jodi Picoult',
    'Category:Novels by Joyce Carol Oates',
    'Category:Novels by Judith Krantz',
    'Category:Novels by Judy Blume',
    'Category:Novels by Julia Alvarez',
    'Category:Novels by Kaari Utrio',
    'Category:Novels by Kage Baker',
    'Category:Novels by Karin Fossum',
    'Category:Novels by Kate Chopin',
    'Category:Novels by Katharine Kerr',
    'Category:Novels by Kathe Koja',
    'Category:Novels by Katherine Kurtz',
    'Category:Novels by Kathryn Lasky',
    'Category:Novels by Kathy Reichs',
    'Category:Novels by Kathy Tyers',
    'Category:Novels by Kavita Daswani',
    'Category:Novels by Kij Johnson',
    'Category:Novels by Kiran Desai',
    'Category:Novels by Kristen Britain',
    'Category:Novels by Laurell K. Hamilton',
    'Category:Novels by Laurie Halse Anderson',
    'Category:Novels by Laurie R. King',
    'Category:Novels by Leigh Brackett',
    'Category:Novels by Leslie Marmon Silko',
    'Category:Novels by Libba Bray',
    'Category:Novels by Lily Brett',
    'Category:Novels by Linda Sue Park',
    'Category:Novels by Lisa Alther',
    'Category:Novels by Lisa See',
    'Category:Novels by Lois-Ann Yamanaka',
    'Category:Novels by Lois Lowry',
    'Category:Novels by Lois McMaster Bujold',
    'Category:Novels by Louisa May Alcott',
    'Category:Novels by Louise Erdrich',
    'Category:Novels by Lucia St. Clair Robson',
    'Category:Novels by Lucy Maud Montgomery',
    'Category:Novels by Lynn Flewelling',
    'Category:Novels by Madeleine L\'Engle',
    'Category:Novels by Maeve Binchy',
    'Category:Novels by Margaret Atwood',
    'Category:Novels by Margaret Peterson Haddix',
    'Category:Novels by Margery Allingham',
    'Category:Novels by Marguerite Henry',
    'Category:Novels by Marion Chesney',
    'Category:Novels by Marion Zimmer Bradley',
    'Category:Novels by Mary Higgins Clark',
    'Category:Novels by MaryJanice Davidson',
    'Category:Novels by Mary McCarthy',
    'Category:Novels by Mary Shelley',
    'Category:Novels by Mary Tappan Wright',
    'Category:Novels by Mary Wollstonecraft',
    'Category:Novels by Meg Cabot',
    'Category:Novels by Melanie Rawn',
    'Category:Novels by Melissa Scott',
    'Category:Novels by Mildred D. Taylor',
    'Category:Novels by Mildred Savage',
    'Category:Novels by Morgan Llywelyn',
    'Category:Novels by Myla Goldberg',
    'Category:Novels by Nadine Gordimer',
    'Category:Novels by Nalo Hopkinson',
    'Category:Novels by Nancy Farmer',
    'Category:Novels by Nancy Holder',
    'Category:Novels by Nancy Varian Berberick',
    'Category:Novels by Neelam Saxena Chandra',
    'Category:Novels by Octavia Butler',
    'Category:Novels by Pam Muñoz Ryan',
    'Category:Novels by Patricia Highsmith',
    'Category:Novels by P. D. James',
    'Category:Novels by Pearl S. Buck',
    'Category:Novels by Peg Kehret',
    'Category:Novels by Phoebe Atwood Taylor',
    'Category:Novels by Phyllis Eisenstein',
    'Category:Novels by Polly Horvath',
    'Category:Novels by Poppy Z. Brite',
    'Category:Novels by Rachel Caine',
    'Category:Novels by Richelle Mead',
    'Category:Novels by Rilla Askew',
    'Category:Novels by Robin Hobb',
    'Category:Novels by Ruth Ozeki',
    'Category:Novels by Ruth Park',
    'Category:Novels by Ruth Rendell',
    'Category:Novels by Sandra Cisneros',
    'Category:Novels by Sandra Scoppettone',
    'Category:Novels by S. E. Hinton',
    'Category:Novels by Sharon Creech',
    'Category:Novels by Sharon Kay Penman',
    'Category:Novels by Sharon Krum',
    'Category:Novels by Shirley Jackson',
    'Category:Novels by Shobha De',
    'Category:Novels by Simone de Beauvoir',
    'Category:Novels by Sister Souljah',
    'Category:Novels by Stephenie Meyer',
    'Category:Novels by Sue Grafton',
    'Category:Novels by Susan Coolidge',
    'Category:Novels by Susanna Rowson',
    'Category:Novels by Suzy McKee Charnas',
    'Category:Novels by Tabitha King',
    'Category:Novels by Tami Hoag',
    'Category:Novels by Tamora Pierce',
    'Category:Novels by Tananarive Due',
    'Category:Novels by Tanith Lee',
    'Category:Novels by Terri Windling',
    'Category:Novels by Terry McMillan',
    'Category:Novels by Toni Morrison',
    'Category:Novels by Ursula K. Le Guin',
    'Category:Novels by Valerie Martin',
    'Category:Novels by V. C. Andrews',
    'Category:Novels by Velma Wallis',
    'Category:Novels by Virginia Woolf',
    'Category:Novels by Vonda McIntyre',
    'Category:Novels by Wendy Coakley-Thompson',
    'Category:Novels by Willa Cather',
    'Category:Novels by Zee Edgell',
    'Category:Novels by Zora Neale Hurston',
    'Category:Organizations for women writers',
    'Category:Ottoman women writers',
    'Category:Outlander',
    'Category:Pakistani women journalists',
    'Category:Pakistani women writers',
    'Category:Palestinian women writers',
    'Category:Paraguayan women poets',
    'Category:Paraguayan women writers',
    'Category:Persian-language women poets',
    'Category:Persian women writers',
    'Category:Peruvian women novelists',
    'Category:Peruvian women poets',
    'Category:Peruvian women writers',
    'Category:Plays by Agatha Christie',
    'Category:Plays by Anita Loos',
    'Category:Plays by Ann-Marie MacDonald',
    'Category:Plays by Aphra Behn',
    'Category:Plays by Ayn Rand',
    'Category:Plays by Baroness Emma Orczy',
    'Category:Plays by Beth Henley',
    'Category:Plays by Daphne de Maurier',
    'Category:Plays by Dorothy L. Sayers',
    'Category:Plays by Ketti Frings',
    'Category:Plays by Lillian Hellman',
    'Category:Plays by Marie Jones',
    'Category:Plays by Mary Shelley',
    'Category:Plays by Patti Smith',
    'Category:Plays by Suzan-Lori Parks',
    'Category:Plays by Zora Neale Hurston',
    'Category:Poetry by Agatha Christie',
    'Category:Poetry by Anne Brontë',
    'Category:Poetry by Gertrude Stein',
    'Category:Poetry by Margaret Atwood',
    'Category:Poetry by Mary Shelley',
    'Category:Poetry by Patti Smith',
    'Category:Poetry by Sylvia Plath',
    'Category:Polish women novelists',
    'Category:Polish women poets',
    'Category:Polish women writers',
    'Category:Portuguese women novelists',
    'Category:Portuguese women poets',
    'Category:Portuguese women writers',
    'Category:Puerto Rican women writers',
    'Category:Red Princess series',
    'Category:Romanian women novelists',
    'Category:Romanian women poets',
    'Category:Romanian women writers',
    'Category:Romantic fiction writers from Northern Ireland',
    'Category:Russian women novelists',
    'Category:Russian women writers',
    'Category:Saint Lucian women poets',
    'Category:Saint Lucian women writers',
    'Category:Samoan women novelists',
    'Category:Samoan women poets',
    'Category:Samoan women writers',
    'Category:São Tomé and Príncipe women writers',
    'Category:Saudi Arabian women writers',
    'Category:Science fiction book series by C. J. Cherryh',
    'Category:Science fiction novels by C. J. Cherryh',
    'Category:Scottish Gaelic women poets',
    'Category:Scottish women dramatists and playwrights',
    'Category:Scottish women novelists',
    'Category:Scottish women poets',
    'Category:Scottish women writers',
    'Category:Screenplays by Anita Loos',
    'Category:Screenplays by Ayn Rand',
    'Category:Screenplays by Beth Henley',
    'Category:Screenplays by Ketti Frings',
    'Category:Screenplays by Leigh Brackett',
    'Category:Screenplays by Lillian Hellman',
    'Category:Screenplays by Suzan-Lori Parks',
    'Category:Senegalese women novelists',
    'Category:Senegalese women writers',
    'Category:Serbian women writers',
    'Category:Series by Tanith Lee',
    'Category:Series of fantasy books by C. J. Cherryh',
    'Category:Shadow Children',
    'Category:Short stories by C. J. Cherryh',
    'Category:Short stories by Daphne du Maurier',
    'Category:Short stories by Doris Lessing',
    'Category:Short stories by Dorothy L. Sayers',
    'Category:Short stories by Edith Wharton',
    'Category:Short stories by Eileen Wilks',
    'Category:Short stories by Elizabeth Gaskell',
    'Category:Short stories by Eudora Welty',
    'Category:Short stories by Flannery O\'Connor',
    'Category:Short stories by Iris Murdoch',
    'Category:Short stories by Kate Chopin',
    'Category:Short stories by Margaret Atwood',
    'Category:Short stories by Mary E. Wilkins Freeman',
    'Category:Short stories by Robin Hobb',
    'Category:Short stories by Shirley Jackson',
    'Category:Short stories by Toni Morrison',
    'Category:Short stories by Ursula K. Le Guin',
    'Category:Short stories by Virginia Woolf',
    'Category:Short stories by Willa Cather',
    'Category:Short stories by Zora Neale Hurston',
    'Category:Short story collections by Agatha Christie',
    'Category:Short story collections by Alice Munro',
    'Category:Short story collections by Anzia Yezierska',
    'Category:Short story collections by Baroness Emma Orczy',
    'Category:Short story collections by Bharati Mukherjee',
    'Category:Short story collections by Caitlín R. Kiernan',
    'Category:Short story collections by Chimamanda Ngozi Adichie',
    'Category:Short story collections by C. J. Cherryh',
    'Category:Short story collections by Cynthia Ozick',
    'Category:Short story collections by Daphne du Maurier',
    'Category:Short story collections by Dorothy L. Sayers',
    'Category:Short story collections by Eudora Welty',
    'Category:Short story collections by Flannery O\'Connor',
    'Category:Short story collections by Jhumpa Lahiri',
    'Category:Short story collections by Joyce Carol Oates',
    'Category:Short story collections by Kage Baker',
    'Category:Short story collections by Lucy Maud Montgomery',
    'Category:Short story collections by Margaret Atwood',
    'Category:Short story collections by Mary E. Wilkins Freeman',
    'Category:Short story collections by MaryJanice Davidson',
    'Category:Short story collections by Nadine Gordimer',
    'Category:Short story collections by Patricia Highsmith',
    'Category:Short story collections by Poppy Z. Brite',
    'Category:Short story collections by Ruth Rendell',
    'Category:Short story collections by Shirley Jackson',
    'Category:Short story collections by Simone de Beauvoir',
    'Category:Short story collections by Tanith Lee',
    'Category:Short story collections by Ursula K. Le Guin',
    'Category:Short story collections by Virginia Woolf',
    'Category:Short story collections by Willa Cather',
    'Category:Slovak women writers',
    'Category:Slovenian women poets',
    'Category:Slovenian women writers',
    'Category:Somalian women novelists',
    'Category:Somalian women writers',
    'Category:South African women journalists',
    'Category:South African women novelists',
    'Category:South African women poets',
    'Category:South African women writers',
    'Category:South Korean women novelists',
    'Category:Soviet women novelists',
    'Category:Soviet women writers',
    'Category:Spanish women journalists',
    'Category:Spanish women novelists',
    'Category:Spanish women poets',
    'Category:Spanish women writers',
    'Category:Sri Lankan women poets',
    'Category:Sri Lankan women writers',
    'Category:Sudanese women writers',
    'Category:Surinamese women writers',
    'Category:Swedish women poets',
    'Category:Swedish women writers',
    'Category:Swiss women writers',
    'Category:Syrian women novelists',
    'Category:Syrian women writers',
    'Category:Taiwanese women writers',
    'Category:Tanzanian women writers',
    'Category:Telugu women writers',
    'Category:The Farseer Trilogy',
    'Category:The Roman Mysteries',
    'Category:The Sea of Trolls Trilogy',
    'Category:The Southern Vampire Mysteries',
    'Category:The Tenant of Wildfell Hall',
    'Category:The Vampire Chronicles',
    'Category:The Vampire Chronicles novels',
    'Category:Time Quartet',
    'Category:Tortallan books',
    'Category:Trinidad and Tobago women novelists',
    'Category:Trinidad and Tobago women writers',
    'Category:Tunisian women journalists',
    'Category:Tunisian women writers',
    'Category:Turkish women journalists',
    'Category:Turkish women poets',
    'Category:Turkish women writers',
    'Category:Twilight series',
    'Category:Ugandan women writers',
    'Category:Ukrainian women writers',
    'Category:Uruguayan women novelists',
    'Category:Uruguayan women writers',
    'Category:Uzbekistani women poets',
    'Category:Uzbekistani women writers',
    'Category:Venezuelan women poets',
    'Category:Venezuelan women writers',
    'Category:Victorian women writers',
    'Category:Vietnamese women poets',
    'Category:Vietnamese women writers',
    'Category:Welsh women novelists',
    'Category:Welsh women poets',
    'Category:Welsh women writers',
    'Category:Women diarists',
    'Category:Women dramatists and playwrights',
    'Category:Women dramatists and playwrights by nationality',
    'Category:Women encyclopedists',
    'Category:Women essayists',
    'Category:Women journalists',
    'Category:Women mystery writers',
    'Category:Women novelists',
    'Category:Women novelists by nationality',
    'Category:Women novelists from Northern Ireland',
    'Category:Women poets',
    'Category:Women poets by era',
    'Category:Women poets by nationality',
    'Category:Women poets from Northern Ireland',
    'Category:Women science fiction and fantasy writers',
    'Category:Women screenwriters',
    'Category:Women short story writers',
    'Category:Women sportswriters',
    'Category:Women television writers',
    'Category:Women translators',
    'Category:Women travel writers',
    'Category:Women war correspondents',
    'Category:Women writers',
    'Category:Women writers (ancient)',
    'Category:Women writers by century',
    'Category:Women writers by format',
    'Category:Women writers by historical period',
    'Category:Women writers by literary movement',
    'Category:Women writers by nationality',
    'Category:Women writers (early Medieval)',
    'Category:Women writers (early modern)',
    'Category:Women writers from Georgia (country)',
    'Category:Women writers from Northern Ireland',
    'Category:Women writers (medieval)',
    'Category:Women writers (modern period)',
    'Category:Women writers (Renaissance)',
    'Category:Works by Agatha Christie',
    'Category:Works by Alice Munro',
    'Category:Works by Anita Loos',
    'Category:Works by Anne Brontë',
    'Category:Works by Annie Proulx',
    'Category:Works by Ann-Marie MacDonald',
    'Category:Works by Anzia Yezierska',
    'Category:Works by Aphra Behn',
    'Category:Works by Astrid Lindgren',
    'Category:Works by Ayn Rand',
    'Category:Works by Barbara Kingsolver',
    'Category:Works by Baroness Emma Orczy',
    'Category:Works by Beth Henley',
    'Category:Works by Bharati Mukherjee',
    'Category:Works by Caitlín R. Kiernan',
    'Category:Works by Caroline Graham',
    'Category:Works by Cecilia Ahern',
    'Category:Works by Charlotte Brontë',
    'Category:Works by Chitra Banerjee Divakaruni',
    'Category:Works by C. J. Cherryh',
    'Category:Works by Cynthia Ozick',
    'Category:Works by Daphne du Maurier',
    'Category:Works by Doris Lessing',
    'Category:Works by Dorothy L. Sayers',
    'Category:Works by Edith Wharton',
    'Category:Works by Edna O\'Brien',
    'Category:Works by Eileen Wilks',
    'Category:Works by Elizabeth Gaskell',
    'Category:Works by Ellen G. White',
    'Category:Works by Emily Brontë',
    'Category:Works by E. Nesbit',
    'Category:Works by Enid Blyton',
    'Category:Works by Eudora Welty',
    'Category:Works by Flannery O\'Connor',
    'Category:Works by Gertrude Stein',
    'Category:Works by Gwendolyn Brooks',
    'Category:Works by Harriet Beecher Stowe',
    'Category:Works by Irene Vilar',
    'Category:Works by Iris Murdoch',
    'Category:Works by Jacqueline Wilson',
    'Category:Works by Jane Roberts',
    'Category:Works by Jhumpa Lahiri',
    'Category:Works by Joan Didion',
    'Category:Works by Joyce Carol Oates',
    'Category:Works by Judy Blume',
    'Category:Works by Kage Baker',
    'Category:Works by Karen Armstrong',
    'Category:Works by Karen Blixen',
    'Category:Works by Kate Chopin',
    'Category:Works by Ketti Frings',
    'Category:Works by Leigh Brackett',
    'Category:Works by Leslie Marmon Silko',
    'Category:Works by Lillian Hellman',
    'Category:Works by Lisa See',
    'Category:Works by Louisa May Alcott',
    'Category:Works by Louise Erdrich',
    'Category:Works by Lucy Maud Montgomery',
    'Category:Works by Madame d\'Aulnoy',
    'Category:Works by Madeleine L\'Engle',
    'Category:Works by Maeve Binchy',
    'Category:Works by Margaret Atwood',
    'Category:Works by Margery Allingham',
    'Category:Works by Marie de France',
    'Category:Works by Marie Jones',
    'Category:Works by Marion Chesney',
    'Category:Works by Marion Zimmer Bradley',
    'Category:Works by Mary Baker Eddy',
    'Category:Works by Mary E. Wilkins Freeman',
    'Category:Works by MaryJanice Davidson',
    'Category:Works by Mary McCarthy',
    'Category:Works by Mary Shelley',
    'Category:Works by Mary Wollstonecraft',
    'Category:Works by Maxine Hong Kingston',
    'Category:Works by Meg Cabot',
    'Category:Works by Nalo Hopkinson',
    'Category:Works by Nora Roberts',
    'Category:Works by Octavia Butler',
    'Category:Works by Ophelia Benson',
    'Category:Works by Patricia Highsmith',
    'Category:Works by Patti Smith',
    'Category:Works by P. D. James',
    'Category:Works by Poppy Z. Brite',
    'Category:Works by Robin Hobb',
    'Category:Works by Ruth Rendell',
    'Category:Works by Sarah Orne Jewett',
    'Category:Works by S. E. Hinton',
    'Category:Works by Selma Lagerlöf',
    'Category:Works by Shirley Jackson',
    'Category:Works by Simone de Beauvoir',
    'Category:Works by Simone Weil',
    'Category:Works by Susan Sontag',
    'Category:Works by Suzan-Lori Parks',
    'Category:Works by Sylvia Plath',
    'Category:Works by Tamora Pierce',
    'Category:Works by Tanith Lee',
    'Category:Works by Toni Morrison',
    'Category:Works by Ursula K. Le Guin',
    'Category:Works by Virginia Woolf',
    'Category:Works by Willa Cather',
    'Category:Works by Zora Neale Hurston',
    'Category:Yemeni women journalists',
    'Category:Yemeni women novelists',
    'Category:Yemeni women poets',
    'Category:Yemeni women writers',
    'Category:Zimbabwean women writers',
);
my @iterators=(
    {
        generator  => 'categorymembers',
        gcmtitle   => [@cats],
        gcmlimit   => 100,
    },
);

### Filter function: manipulate the found data as necessary, returning the talk
### page to tag (or undef to skip).
sub filter {
    $_[0]->{'title'}='Talk:'.$_[0]->{'title'} if $_[0]->{'ns'}==0;
    $_[0]->{'title'}=~s/^([^:]*):/$1 talk:/ if($_[0]->{'ns'}!=0 && ($_[0]->{'ns'}&1)==0);
    return $_[0]->{'title'};
}

### How to copy other projects' assessments
sub copy_class {
    return ($_[0]->WPBmax($_[2]))[0];
    #return '';
}

sub copy_importance {
    #return ($_[0]->WPBmax($_[2]))[1];
    return '';
}

# Banner configurations.
my $main_banner='WikiProject Women writers';
my @preprocess_templates=();
my %banner_cfgs=(
    'WikiProject Women writers' => {
        meta => 1,
        canonicalize => 'WikiProject Women writers',
    },
);

my @main_banners=(
    $main_banner,
);

sub new {
    my $class=shift;
    my $self=$class->SUPER::new();
    $self->{'config loaded'}=0;
    $self->{'iter'}=undef;
    $self->{'iterators'}=[@iterators];
    bless $self, $class;
    return $self;
}

=pod

=for info
Approved 2009-04-08<br />[[Wikipedia:Bots/Requests for approval/AnomieBOT 28]]

=cut

sub approved {
    return -1;
}

sub run {
    my ($self, $api)=@_;
    my $res;

    $api->task('WikiProjectWorker', 0, 10, qw/d::WikiProjectTagging/);
    my $errto = 'Errors? [[User:'.$api->user.'/shutoff/WikiProjectWorker]]';

    # Load configs, if necessary
    if(!$self->{'config loaded'}){
        my %cfg=();
        while(my ($banner,$cfg)=each %banner_cfgs){
            $cfg=$api->WPBMetaConfig($cfg->{'meta'}, %$cfg) if exists($cfg->{'meta'});
            $cfg{$banner}=$cfg;
            $banner_cfgs{$banner}{'stubauto'}=$cfg->{'stubauto'};
        }
        $api->WPBconfig(%cfg);

        $self->{'config loaded'}=1;
    }
    if(($api->store->{'configured'} // 0) < $seq){
        ### Initialize configuration here
    }

    # Spend a max of 5 minutes on this task before restarting
    my $endtime=time()+300;

    while(1){
        my $iter=$self->{'iter'};
        if(!defined($iter)){
            my $i=shift @{$self->{'iterators'}};
            last unless $i;
            $iter=$api->iterator(%$i);
            $self->{'iter'}=$iter;
        }
        while(my $page=$iter->next()){
            if(!$page->{'_ok_'}){
                $api->warn("Could not retrieve page from iterator: ".$page->{'error'}."\n");
                return 60;
            }

            my $pageid=$page->{'pageid'};
            next if ($api->store->{$pageid} // 0) >= $seq;

            my $title=filter($page);
            if(!defined($title)){
                $api->log("Skipping ".$page->{'title'}.", filter returned undef");
                $api->store->{$pageid}=$seq;
                next;
            }

            my $tok=$api->edittoken($title, EditRedir => 1);
            if($tok->{'code'} eq 'shutoff'){
                $api->warn("Task disabled: ".$tok->{'content'}."\n");
                return 300;
            }
            if($tok->{'code'} ne 'success'){
                $api->warn("Failed to get edit token for $title: ".$tok->{'error'}."\n");
                next;
            }
            if(($tok->{'ns'}&1)==0){
                $api->log("Cannot edit $title: namespace ".$tok->{'ns'}." is non-talk");
                $api->store->{$pageid}=$seq;
                next;
            }
            if(exists($tok->{'redirect'})){
                $api->log("$title is a redirect, skipping.");
                $api->store->{$pageid}=$seq;
                next;
            }

            $api->log("Checking $title...");

            my $intxt=$tok->{'revisions'}[0]{'*'} // '';
            my ($outtxt,$nowiki)=$api->strip_nowiki($intxt);

            my @params=();

            my $assess = undef;
            my $class = copy_class($api, $title, $intxt);
            if(ref($class) eq 'HASH'){
                $api->warn("Processing $title failed: ".$class->{'error'}."\n");
                next;
            }
            $class=~s/^\s+|\s+$//g;
            $assess=$api->WPBassess($title);
            if(ref($assess) eq 'HASH'){
                if($assess->{'code'} eq 'pagemissing'){
                    # No subject page, doesn't matter
                    $assess=undef;
                } else {
                    $api->warn("Processing $title failed: ".$assess->{'error'}."\n");
                    next;
                }
            }

            my $copy_importance = 1; # Always copy?
            if($class eq '' || lc($class) eq lc($assess)){
                $class='';
            } else {
                $assess=undef;
                push @params, "class=$class";
                $copy_importance = 1;
            }

            if($copy_importance){
                my $imp = copy_importance($api, $title, $intxt);
                if(ref($imp) eq 'HASH'){
                    $api->warn("Processing $title failed: ".$imp->{'error'}."\n");
                    next;
                }
                push @params, "importance=$imp"; # if ($imp//'') ne '';
            }

            my $need_main_banner = ($api->WPBcheck($outtxt, $main_banner) == 0);
            if(0){
                # grr, already redirected so the above always returns true
                $need_main_banner=1;
                $api->WPBcheck($outtxt, sub {
                        my $banner=shift;
                        my $name=shift;
                        $need_main_banner=0 if(grep $name eq $_, @main_banners);
                        return undef;
                    }, $main_banner);
            }

            ### PROCESSING ###

            my @merge=();
            my @summary=();

            if(@preprocess_templates){
                (undef,$outtxt)=$api->WPBcheck($outtxt, sub {
                    my $banner=shift;
                    my $name=shift;
                    my $oname=shift;
                    my $params=shift;
                    my $wikitext=shift;

                    return undef if(grep $name eq $_, @main_banners);

                    push @merge, $oname;

                    return '' unless $need_main_banner;
                    $need_main_banner=0;
                    return "{{$main_banner}}";
                }, @preprocess_templates);
                if(ref($outtxt) eq 'HASH'){
                    $api->warn("Preprocessing $title failed: ".$outtxt->{'error'}."\n");
                    next;
                }
                if(@merge){
                    $merge[-1]='and '.$merge[-1] if @merge>1;
                    push @summary, "merging ".join((@merge>2)?', ':' ', @merge)." into $main_banner" if @merge;
                } else {
                #    $api->warn("$title contains ".$iter->iterval.", but not in section 0\n");
                    next;
                }
            }

            my $tag;
            my $pg=$title;
            $pg=~s/^Talk://;
            if($page->{'title'} ne $pg){
                $page=$api->query(
                    titles       => $pg,
                    prop         => 'info',
                    redirects    => 1,
                );
                if($page->{'code'} ne 'success'){
                    $api->warn("Could not load $pg info: ".$page->{'error'}."\n");
                    return 60;
                }

                $page=(values %{$page->{'query'}{'pages'}})[0];
            }

            $outtxt=$api->WPBadd($outtxt, $assess, sub {
                my $banner=shift; # banner
                my $name=shift; # name
                my $oname=shift;
                my $params=shift;
                my $wikitext=shift;
                my $new=shift;
                #return '' if $new;

                return undef unless(grep $banner eq $_, @main_banners);
                my %cfg=%{$banner_cfgs{$banner}};

                my $any=0;
                foreach my $p (@params){
                    next unless $p=~/^(.+?)=(.*)$/;
                    my ($k,$v)=($1,$2);
                    my $re=qr/\S/;
                    unless(grep(/^\s*\Q$k\E\s*=\s*$re\s*$/, @$params)){
                        next if(grep(/^\s*\Q$k\E\s*=\s*(?i:\Q$v\E)\s*$/s, @$params));
                        unshift @$params, "$k=$v" unless(grep(s/^(\s*\Q$k\E\s*=\s*?)(?:\S.*?)?(\s*)$/$1$v$2/s, @$params));
                        $any=1 unless $v eq '';
                        if($k eq 'class' && ($cfg{'meta'}//0) && ($cfg{'stubauto'}//'')){
                            my $aa=$cfg{'stubauto'};
                            $aa=~s/\s*=.*//;
                            push @$params, "$aa=inherit" unless(grep(s/^(\s*\Q$aa\E\s*=\s*?)(?:\S.*?)?(\s*)$/$1inherit$2/s, @$params));
                        }
                    }
                }
                if($new && $class && (grep /^class=/, @$params) && ($cfg{'meta'}//0) && ($cfg{'stubauto'}//'')){
                    my $aa=$cfg{'stubauto'};
                    $aa=~s/\s*=.*//;
                    push @$params, "$aa=inherit" unless(grep(s/^(\s*\Q$aa\E\s*=\s*?)(?:\S.*?)?(\s*)$/$1inherit$2/s, @$params));
                    $any=1;
                }
                return $wikitext unless $any;

                if(defined($cfg{'canonicalize'})){
                    my $n=$cfg{'canonicalize'};
                    $oname=~s/_/ /g;
                    $oname=~s/^(\s*)\S(?:.*\S)?(\s*)$/$1$n$2/is;
                }
                my $out="{{$oname";
                $out.="|".join("|", @$params) if @$params;
                $out.="}}";
                return $out;
            }, $main_banner, @params);
            if(ref($outtxt) eq 'HASH'){
                $api->warn("Processing $title failed: ".$outtxt->{'error'}."\n");
                next;
            }
            push @summary, "Tagging with {{$main_banner}}" unless @summary;

            $outtxt=$api->replace_nowiki($outtxt, $nowiki);

            # Need to edit?
            if($outtxt ne $intxt){
                if(!@summary){
                    $api->warn("$title changed, but nothing in \@summary\n");
                    next;
                }
                my $cat=$iter->iterval;
                $summary[-1]='and '.$summary[-1] if @summary>1;
                my $summary = ucfirst(join((@summary>2)?', ':' ', @summary))." per $req";

                my @cleanup=();
                $outtxt=$api->WPBfixshell($outtxt, \@cleanup);
                if(ref($outtxt) eq 'HASH'){
                    $api->warn("Processing $title failed: ".$outtxt->{'error'}."\n");
                    next;
                }
                $summary.="; general banner cleanup (".join(', ', @cleanup).")" if @cleanup;
                $summary.=". $errto";

                $api->log("$summary in $title");
                my $r=$api->edit($tok, $outtxt, $summary, 1, 1);
                if($r->{'code'} ne 'success'){
                    $api->warn("Write failed on $title: ".$r->{'error'}."\n");
                    next;
                }
            } else {
                $api->log("Nothing to do in $title");
            }

            # Remember that we processed this page already
            $api->store->{$pageid}=$seq;

            # If we've been at it long enough, let another task have a go.
            return 0 if time()>=$endtime;
        }
        $self->{'iter'}=undef;
    }

    # No more pages to check, try again in 10 minutes or so in case of errors.
    $self->{'iter'}=undef;
    $self->{'iterators'}=[@iterators];
    $api->log("WikiProjectWorker may be DONE!");
    return 600;
}