User:FritzpollBot/Code for task 3
Private Sub ExecuteTask3(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim s As New DotNetWikiBot.Site(sourceSite.Text, "Fritzpoll", ''password redacted'')
Dim p As New DotNetWikiBot.PageList(s)
Dim prefix As String = Mid(sourceSite.Text, 1, InStr(sourceSite.Text, ".") - 1)
Dim returner As New ArrayList()
p.FillSubsFromCategory(sourceCategory.Text)
p.Insert(New DotNetWikiBot.Page(s, s.CorrectNSPrefix("Category:" & sourceCategory.Text)), 0)
For Each cat As DotNetWikiBot.Page In p
returner.Add(vbCrLf & "===[[:" & prefix & ":" & cat.title & "]]===" & vbCrLf)
Dim pList As New DotNetWikiBot.PageList(s)
pList.FillFromCategory(cat.title)
For Each pg As DotNetWikiBot.Page In pList.pages
Dim interWiki As String()
pg.Load()
If pg.IsEmpty() Then
Continue For
End If
interWiki = pg.GetInterWikiLinks(False)
Dim enFound As Boolean = False
For Each ss As String In interWiki
If InStr(ss, "en:") <> 0 Then
enFound = True
Exit For
End If
Next
If Not enFound Then
returner.Add("[[" & pg.title & "]] ([[:" & prefix & ":" & pg.title & "|" & prefix & "]])")
End If
Next
Next
s = New DotNetWikiBot.Site("en.wikipedia.org", "FritzpollBot", ''password redacted'')
Dim pp As New DotNetWikiBot.Page(s, targetPage.Text)
pp.Load()
Dim j As Integer
pp.text = ""
For j = 0 To returner.Count - 1
pp.text = pp.text & returner(j) & vbCrLf
Next
pp.Save("Updating - test edit", False)
MessageBox.Show("Done")
End Sub
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.