Codepotatoes.Scraper.HowLongToBeat
1.2.0
dotnet add package Codepotatoes.Scraper.HowLongToBeat --version 1.2.0
NuGet\Install-Package Codepotatoes.Scraper.HowLongToBeat -Version 1.2.0
<PackageReference Include="Codepotatoes.Scraper.HowLongToBeat" Version="1.2.0" />
<PackageVersion Include="Codepotatoes.Scraper.HowLongToBeat" Version="1.2.0" />
<PackageReference Include="Codepotatoes.Scraper.HowLongToBeat" />
paket add Codepotatoes.Scraper.HowLongToBeat --version 1.2.0
#r "nuget: Codepotatoes.Scraper.HowLongToBeat, 1.2.0"
#addin nuget:?package=Codepotatoes.Scraper.HowLongToBeat&version=1.2.0
#tool nuget:?package=Codepotatoes.Scraper.HowLongToBeat&version=1.2.0
HowLongToBeatScraper
As we're still missing an api to fetch data from Howlongtobeat
this project aims to bridge the gap in the meantime.
Usage
Install the package:
dotnet add package Crashdummy.Scraper.HowLongToBeat
using var scraper = new HltbScraper();
// or
using var scraper = new HltbScraper(seekMagic: "d4b2e330db04dbf3")
// Simple search with works as in using the howlongtobeat.com page
IEnumerable<GameEntry> results = await scraper.Search("Borderlands 3");
// Advanced search
var query = new QueryBuilder().WithSearchType(SearchOptions.Type.Users)
.WithModifier(SearchOptions.Modifier.HideModsAndDlc);
IEnumerable<GameEntry> results = await scraper.Search(query);
Regarding the "seekmagic"
The main endpoint that is being used is /api/Seek/<seekMagic>
.
This requires however to obtain a magic hash that can be found in two different ways:
- Somewhere in the depths of the
**/_app*.js
file - Checking the POST request in the developer console when accessing howlongtobeat.com
The constructor can be empty.
In this case the _app*.js
file is downloaded and parsed.
This will fail eventually and takes a bit longer during the first request ( duh ).
If feasible its highly recommended to preemptively set the magic.
Dependencies
For some reason /api/price-checks/<gameid>
, only returns the gogAppId.
The SteamAppId has to be provided within the body which thus defeats the purpose.
Until theres a better way we need to scrape it there
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- AngleSharp (>= 1.3.0)
-
net9.0
- AngleSharp (>= 1.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.