Replies: 2 comments 2 replies
-
If possible, I would suggest using replace_tool, it is a well-tested tool. But I'm sorry I haven't written the documentation for that part yet, so you can only refer to the examples here. In your case it would be easier to just return the Wikiapi.skip_edit. I also suggest you use for_each_page. |
Beta Was this translation helpful? Give feedback.
2 replies
-
On my side, I eventually used await targetWiki.edit_page(title,
function(page_data)
{ // Do things:
console.log('page_data.text: ', page_data.wikitext);
if( page_data.wikitext.search(/==\n{{cc-by-sa-4.0}}/g) == -1){ return Wikiapi.skip_edit;}
return page_data.wikitext.replace(/==\n{{cc-by-sa-4.0}}/g,
'==\n{{Multi-license}}\n{{cc-by-sa-4.0}}\n{{cc-0}}')
},
{
bot: 1, nocreate: 1, minor: 1,
summary: `Update licenses according to user's wishes, see statement in [[Special:Diff/672130985]].`
}
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My
.edit
+.replace
is too slow (1 edit every 5 secs) :When the script fails, it resume editing at the start of the list of 6000+ pages in my target category.
Where should I put a conditional read, so it quicky search if there is the target string to replace, then
Beta Was this translation helpful? Give feedback.
All reactions