Hi,
I've written a PowerShell example that uses DotNetWikiBot.dll.
$LocalFolderToSaveTo = "C:\DownloadLocation" [System.Reflection.Assembly]::LoadFile("D:\Documents\WindowsPowerShell\test\dotnetwikibot\DotNetWikiBot.dll") $EnWiki = new-object DotNetWikiBot.Site("http://en.wikipedia.org", "WikipediaUserName", "WikipediaPassword"); $PageList = new-object DotNetWikiBot.PageList($enWiki); $PageList.FillFromCategory("Featured pictures") $ImageExts = ".jpg", ".png", ".jpeg" Foreach($Page in $PageList.pages) { if(($ImageExts -eq $Page.Title.substring($Page.Title.length - 4, 4)) -and (!($Page.Title.startswith("File talk"))) ) { $DownloadTo = $Null $RenamedPage = $Page.Title.replace("File:", "") $RenamedPage = $RenamedPage.replace("`"", "") # " $RenamedPage = $RenamedPage.replace("`'", "") $DownloadTo = join-path $LocalFolderToSaveTo ($RenamedPage) $page.DownloadImage($DownloadTo) } }
Regards,
Winfred
( Article on my site )
That's cool. If someone asks me about PowerShell, I'll refer them right to your article.
Log in to post a comment.
Hi,
I've written a PowerShell example that uses DotNetWikiBot.dll.
Regards,
Winfred
( Article on my site )
That's cool. If someone asks me about PowerShell, I'll refer them right to your article.