Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Imbick.StarCitizen.Api/GetOrgsRestRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using Models;
using RestSharp;
using SimpleJson;

public class GetOrgsRestRequest
: RestRequest {
Expand Down
4 changes: 2 additions & 2 deletions Imbick.StarCitizen.Api/Imbick.StarCitizen.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.8.13" />
<PackageReference Include="RestSharp" Version="106.6.7" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.15" />
<PackageReference Include="RestSharp" Version="106.6.10" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion Imbick.StarCitizen.Api/OrganisationHtmlSerialiser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public Organisation Deserialise(string org) {
private Organisation Deserialise(HtmlNode orgNode) {
try {
return new Organisation {
Name = orgNode.SelectSingleNode("./a[@class=\"trans-03s clearfix\"]/span[2]/span[2]/h3[@class=\"trans-03s name\"]").InnerText,
Name = HtmlEntity.DeEntitize(orgNode.SelectSingleNode("./a[@class=\"trans-03s clearfix\"]/span[2]/span[2]/h3[@class=\"trans-03s name\"]").InnerText),
Symbol = orgNode.SelectSingleNode("./a[@class=\"trans-03s clearfix\"]/span[2]/span[2]/span[@class=\"symbol\"]").InnerText,
ThumbnailUrl = orgNode.SelectSingleNode("./a[@class=\"trans-03s clearfix\"]/span[2]/span[1]/img").GetAttributeValue("src", string.Empty),
Archetype = ToArchetype(orgNode.SelectSingleNode("./a[@class=\"trans-03s clearfix\"]/span[3]/span[1]/span[1]//span[2]").InnerText),
Expand Down
2 changes: 1 addition & 1 deletion Imbick.StarCitizen.Api/OrganisationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<IEnumerable<Organisation>> GetAsync(SearchRequest searchReques
var response = await _client.ExecutePostTaskAsync<Response>(request);
if (!response.IsSuccessful)
throw new Exception($"Request to endpoint was unsuccessful. {response.ErrorMessage}");
var decodedHtml = response.Data.Data.Html.Replace("\\\"", "\""); //todo properly decode this
var decodedHtml = SimpleJson.DeserializeObject<string>("\"" + response.Data.Data.Html + "\"", SimpleJson.CurrentJsonSerializerStrategy);
return _deserialiser.DeserialiseList(decodedHtml);
} catch (Exception e) {
throw new Exception("Problem retrieving orgs. See inner exception for details.", e);
Expand Down