Skip to content

Commit 647047a

Browse files
committed
upgrade wiki library and target .net 9 (used to be .net 7)
1 parent 4a0cdbc commit 647047a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tools/WikiLinks/Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
using MwParserFromScratch.Nodes;
1010

1111
string linkJsonLocation = @"c:\linkJson";
12-
string wikiApiUrl = "https://bogleheads.org/w/api.php";
13-
string wikiBaseUrl = "https://bogleheads.org/wiki/";
1412

1513
int amountOfItems = 2000; // todo: don't hardcode this
1614
HttpClient httpClient = new() { Timeout = TimeSpan.FromSeconds(15) };
@@ -20,9 +18,12 @@
2018
bool showSuccesses = false; //if set to true, will list all pages (even if they have no external links), and all external links, even if they are OK.
2119
bool forceFetch = false;
2220
bool outputCSV = false;
21+
string wikiBaseUrl = "https://bogleheads.org/wiki/";
22+
string wikiApiUrl = "https://bogleheads.org/w/api.php";
2323

2424
var client = new WikiClient();
25-
var wikiSite = new WikiSite(client, wikiApiUrl);
25+
SiteOptions options = new() { AccountAssertion = AccountAssertionBehavior.AssertBot, ApiEndpoint = wikiApiUrl };
26+
var wikiSite = new WikiSite(client, options);
2627
await wikiSite.Initialization;
2728

2829
await ProcessAllPages(wikiSite);

tools/WikiLinks/WikiLinks.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace>Bogle.Tools.WikiLinks</RootNamespace>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
</PropertyGroup>
1010

1111
<ItemGroup>
1212
<PackageReference Include="CXuesong.MW.MwParserFromScratch" Version="0.3.0-int.6" />
13-
<PackageReference Include="CXuesong.MW.WikiClientLibrary" Version="0.8.0-int.7" />
13+
<PackageReference Include="CXuesong.MW.WikiClientLibrary" Version="0.8.0" />
1414
</ItemGroup>
1515

1616
</Project>

0 commit comments

Comments
 (0)