chore: add AngleSharp dependency and refactor rant scraping to use CSS class queries

- Add AngleSharp NuGet package version 1.1.2 to csproj for HTML parsing
- Introduce DomQueryClass helper method using AngleSharp to extract elements by CSS class name
- Replace XPath-based node selection in get_rants with DomQueryClass targeting "rantlist-title-text"
- Update Program.cs to await RunIt task and add a 100-iteration loop around rant fetching
- Add transform string concatenation utility method to Program class
This commit is contained in:
2024-12-17 11:10:58 +00:00
parent a3cce3425f
commit da6d3d747b
19 changed files with 201 additions and 18 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("drnetapi")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9e0e316cd3b7bd2058c7ce9b967b5ac68422bf36")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+7fb519f419449f9dc0b2470d5e22b37ba71c9969")]
[assembly: System.Reflection.AssemblyProductAttribute("drnetapi")]
[assembly: System.Reflection.AssemblyTitleAttribute("drnetapi")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
f0a018514b0ac9989cefd4e8304d6c22b9ba22f2036bcbdc20cd35b98e0929b3
885952bf447ff1bea5505c35b1c8231624b933a12c032ef1d33f249f3074a7e0
Binary file not shown.
@@ -1 +1 @@
5e3e99658f7cc8eb082cd7c6cd551b3ff500dd816707657a9c3f556f838b6d19
cb53997bd4f956d6fe419ccaf3b77c877689b448a89934fef62624a0029ccea3
@@ -46,3 +46,4 @@
/home/retoor/projects/drnetapi/obj/Debug/net8.0/drnetapi.pdb
/home/retoor/projects/drnetapi/obj/Debug/net8.0/drnetapi.genruntimeconfig.cache
/home/retoor/projects/drnetapi/obj/Debug/net8.0/ref/drnetapi.dll
/home/retoor/projects/drnetapi/bin/Debug/net8.0/AngleSharp.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
View File
@@ -38,6 +38,10 @@
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"AngleSharp": {
"target": "Package",
"version": "[1.1.2, )"
},
"GtkSharp": {
"target": "Package",
"version": "[3.24.24.95, )"
+110
View File
@@ -2,6 +2,22 @@
"version": 3,
"targets": {
"net8.0": {
"AngleSharp/1.1.2": {
"type": "package",
"dependencies": {
"System.Text.Encoding.CodePages": "8.0.0"
},
"compile": {
"lib/net8.0/AngleSharp.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/AngleSharp.dll": {
"related": ".xml"
}
}
},
"AtkSharp/3.24.24.95": {
"type": "package",
"dependencies": {
@@ -104,10 +120,57 @@
"runtime": {
"lib/net6.0/PangoSharp.dll": {}
}
},
"System.Text.Encoding.CodePages/8.0.0": {
"type": "package",
"compile": {
"lib/net8.0/System.Text.Encoding.CodePages.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net8.0/System.Text.Encoding.CodePages.dll": {
"related": ".xml"
}
},
"build": {
"buildTransitive/net6.0/_._": {}
},
"runtimeTargets": {
"runtimes/win/lib/net8.0/System.Text.Encoding.CodePages.dll": {
"assetType": "runtime",
"rid": "win"
}
}
}
}
},
"libraries": {
"AngleSharp/1.1.2": {
"sha512": "aRFpAqixbuj1Vmqy2hsWPF0PJygo1SfjvmpBvVWZv6i+/u+C/L4wDdwFIzyCGUbjqr61NsZdPNPqDE8wlmG2qA==",
"type": "package",
"path": "anglesharp/1.1.2",
"files": [
".nupkg.metadata",
".signature.p7s",
"README.md",
"anglesharp.1.1.2.nupkg.sha512",
"anglesharp.nuspec",
"lib/net461/AngleSharp.dll",
"lib/net461/AngleSharp.xml",
"lib/net472/AngleSharp.dll",
"lib/net472/AngleSharp.xml",
"lib/net6.0/AngleSharp.dll",
"lib/net6.0/AngleSharp.xml",
"lib/net7.0/AngleSharp.dll",
"lib/net7.0/AngleSharp.xml",
"lib/net8.0/AngleSharp.dll",
"lib/net8.0/AngleSharp.xml",
"lib/netstandard2.0/AngleSharp.dll",
"lib/netstandard2.0/AngleSharp.xml",
"logo.png"
]
},
"AtkSharp/3.24.24.95": {
"sha512": "LnSfsc0y11gfzczZj5bnpwcFkXFZuVTSSd92ML/FcHIM7FU+cAfm1UkAonv5BdwTRhzDbNDE39vihao/k75sUA==",
"type": "package",
@@ -248,10 +311,53 @@
"pangosharp.3.24.24.95.nupkg.sha512",
"pangosharp.nuspec"
]
},
"System.Text.Encoding.CodePages/8.0.0": {
"sha512": "OZIsVplFGaVY90G2SbpgU7EnCoOO5pw1t4ic21dBF3/1omrJFpAGoNAVpPyMVOC90/hvgkGG3VFqR13YgZMQfg==",
"type": "package",
"path": "system.text.encoding.codepages/8.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/System.Text.Encoding.CodePages.targets",
"buildTransitive/net462/_._",
"buildTransitive/net6.0/_._",
"buildTransitive/netcoreapp2.0/System.Text.Encoding.CodePages.targets",
"lib/MonoAndroid10/_._",
"lib/MonoTouch10/_._",
"lib/net462/System.Text.Encoding.CodePages.dll",
"lib/net462/System.Text.Encoding.CodePages.xml",
"lib/net6.0/System.Text.Encoding.CodePages.dll",
"lib/net6.0/System.Text.Encoding.CodePages.xml",
"lib/net7.0/System.Text.Encoding.CodePages.dll",
"lib/net7.0/System.Text.Encoding.CodePages.xml",
"lib/net8.0/System.Text.Encoding.CodePages.dll",
"lib/net8.0/System.Text.Encoding.CodePages.xml",
"lib/netstandard2.0/System.Text.Encoding.CodePages.dll",
"lib/netstandard2.0/System.Text.Encoding.CodePages.xml",
"lib/xamarinios10/_._",
"lib/xamarinmac20/_._",
"lib/xamarintvos10/_._",
"lib/xamarinwatchos10/_._",
"runtimes/win/lib/net6.0/System.Text.Encoding.CodePages.dll",
"runtimes/win/lib/net6.0/System.Text.Encoding.CodePages.xml",
"runtimes/win/lib/net7.0/System.Text.Encoding.CodePages.dll",
"runtimes/win/lib/net7.0/System.Text.Encoding.CodePages.xml",
"runtimes/win/lib/net8.0/System.Text.Encoding.CodePages.dll",
"runtimes/win/lib/net8.0/System.Text.Encoding.CodePages.xml",
"system.text.encoding.codepages.8.0.0.nupkg.sha512",
"system.text.encoding.codepages.nuspec",
"useSharedDesignerContext.txt"
]
}
},
"projectFileDependencyGroups": {
"net8.0": [
"AngleSharp >= 1.1.2",
"GtkSharp >= 3.24.24.95",
"HtmlAgilityPack >= 1.11.71"
]
@@ -293,6 +399,10 @@
"net8.0": {
"targetAlias": "net8.0",
"dependencies": {
"AngleSharp": {
"target": "Package",
"version": "[1.1.2, )"
},
"GtkSharp": {
"target": "Package",
"version": "[3.24.24.95, )"
+4 -2
View File
@@ -1,9 +1,10 @@
{
"version": 2,
"dgSpecHash": "VIlMwTGgkTVOiBw98wHhoWW718Npjy/Ut4cwyxXucRy0cpVBB5mTlCmsEmH3z+G0GBCPZusaB8XMvWEhW8spNA==",
"dgSpecHash": "vtE4V6sCh/ezJsnT0M5QEo7noKBcpCVJldaAh0oCljeGBNXR9QdZzpjKNgqgY0x1ZubZYDuNfniHqXhJPPul/Q==",
"success": true,
"projectFilePath": "/home/retoor/projects/drnetapi/drnetapi.csproj",
"expectedPackageFiles": [
"/home/retoor/.nuget/packages/anglesharp/1.1.2/anglesharp.1.1.2.nupkg.sha512",
"/home/retoor/.nuget/packages/atksharp/3.24.24.95/atksharp.3.24.24.95.nupkg.sha512",
"/home/retoor/.nuget/packages/cairosharp/3.24.24.95/cairosharp.3.24.24.95.nupkg.sha512",
"/home/retoor/.nuget/packages/gdksharp/3.24.24.95/gdksharp.3.24.24.95.nupkg.sha512",
@@ -11,7 +12,8 @@
"/home/retoor/.nuget/packages/glibsharp/3.24.24.95/glibsharp.3.24.24.95.nupkg.sha512",
"/home/retoor/.nuget/packages/gtksharp/3.24.24.95/gtksharp.3.24.24.95.nupkg.sha512",
"/home/retoor/.nuget/packages/htmlagilitypack/1.11.71/htmlagilitypack.1.11.71.nupkg.sha512",
"/home/retoor/.nuget/packages/pangosharp/3.24.24.95/pangosharp.3.24.24.95.nupkg.sha512"
"/home/retoor/.nuget/packages/pangosharp/3.24.24.95/pangosharp.3.24.24.95.nupkg.sha512",
"/home/retoor/.nuget/packages/system.text.encoding.codepages/8.0.0/system.text.encoding.codepages.8.0.0.nupkg.sha512"
],
"logs": []
}