Sorry, the topic "Waht" was posted before I corrected the subject and edited content.
I dont't find a method like Disconnect or Logout. Under which circumstances is a Site instance disposed? By closing the application? By creating a new instance? After 30 days if the wiki enables to stay logged in?
On the other side, all WMF projects use Single User Login (SUL) accounts in the meanwhile: login to one project causes logged in to all projects. Is there any problem to use several instances at the same time: siteWBde for de-Wikibooks, siteWPde for de-Wikipedia, siteWBen for en-Wikibooks, and so on?
My aim as de-WB sysop is: The bot shall delete redirects and pages for speedy deletions. Before deleting the bot has to check what pages link to a specific page. That's no problem inside de-WB. Moreover, there may be links from de-Wikipedia, de-Wikiversity, or en-Wikibooks to the de-WB page. My Bot must work in the following way:
FillFromCategory(speedy deletions) - inside de-WB, therefore using siteWBde
foreach(Page p in pl_WBde)
check the existence of links inside de-WB - using siteWBde - and redirect or remove in de-WB
make a note of external links - using siteWBde
redirect or remove links from de-WP - using siteWPde
redirect or remove links from en-WB - using siteWBen
and so on in other projects
if there's no link left, the bot may delete - using siteWBde - otherwise the bot gives a message and continues
All external links are saved in a special de-WB page.
Are there any problems to switch between several site instances? Or would it be better practice to use one site instance after another:
FillFromCategory(speedy deletions) - using siteWBde
redirect or remove links inside de-WB, make a note of external links
redirect or remove links from de-WP - using site WPde - and so on
delete inside de-WB, if possible
I'ld thank for some explanations using the site class in this situation. Juergen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Every site must have a corresponding Site object, e.g. Site siteWPde for German Wikipedia, Site siteWPen for English Wikipedia and so on. Don't worry about SUL.
There is no problem to have many Site objects in your program simultaneously and act using them simultaneously. In fact it is a very common practice to carry out cross-site jobs using several Site objects at the same time.
Site instance is disposed when it is out of program scope.
I just would advise against creating several Site objects for the same site in one program, it's not good.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, the topic "Waht" was posted before I corrected the subject and edited content.
I dont't find a method like Disconnect or Logout. Under which circumstances is a Site instance disposed? By closing the application? By creating a new instance? After 30 days if the wiki enables to stay logged in?
On the other side, all WMF projects use Single User Login (SUL) accounts in the meanwhile: login to one project causes logged in to all projects. Is there any problem to use several instances at the same time: siteWBde for de-Wikibooks, siteWPde for de-Wikipedia, siteWBen for en-Wikibooks, and so on?
My aim as de-WB sysop is: The bot shall delete redirects and pages for speedy deletions. Before deleting the bot has to check what pages link to a specific page. That's no problem inside de-WB. Moreover, there may be links from de-Wikipedia, de-Wikiversity, or en-Wikibooks to the de-WB page. My Bot must work in the following way:
All external links are saved in a special de-WB page.
Are there any problems to switch between several site instances? Or would it be better practice to use one site instance after another:
I'ld thank for some explanations using the site class in this situation. Juergen
Every site must have a corresponding Site object, e.g. Site siteWPde for German Wikipedia, Site siteWPen for English Wikipedia and so on. Don't worry about SUL.
There is no problem to have many Site objects in your program simultaneously and act using them simultaneously. In fact it is a very common practice to carry out cross-site jobs using several Site objects at the same time.
Site instance is disposed when it is out of program scope.
I just would advise against creating several Site objects for the same site in one program, it's not good.
Thank you for the explanation. Now I know what to do. Juergen