diff --git a/NetTally.Core/Input/Forums/Adapters2/XenForo1Adapter2.cs b/NetTally.Core/Input/Forums/Adapters2/XenForo1Adapter2.cs
index f27f6cab..fa7e2432 100644
--- a/NetTally.Core/Input/Forums/Adapters2/XenForo1Adapter2.cs
+++ b/NetTally.Core/Input/Forums/Adapters2/XenForo1Adapter2.cs
@@ -491,11 +491,17 @@ namespace NetTally.Forums.Adapters2
private string GetPostText(HtmlNode li, IQuest quest)
{
+ string a = li.InnerHtml;
+
+ HtmlDocument htmlDoc = new HtmlDocument();
+ htmlDoc.LoadHtml("<!DOCTYPE html><html><body> " + a + "</body></html>");
+ HtmlNode heu = htmlDoc.DocumentNode;
// Get the primary content of the list item
- HtmlNode? primaryContent = li.GetChildWithClass("primaryContent");
+
+ HtmlNode? primaryContent = heu.GetDescendantWithClass("primaryContent");
// On one branch, we can get the post text
- HtmlNode? messageContent = primaryContent?.GetChildWithClass("messageContent");
+ HtmlNode ? messageContent = primaryContent?.GetChildWithClass("messageContent");
HtmlNode? postBlock = messageContent?.Element("article")?.Element("blockquote");
List<string> excludedClasses = new List<string> { "bbCodeQuote", "messageTextEndMarker","advbbcodebar_encadre",
@@ -514,8 +520,14 @@ namespace NetTally.Forums.Adapters2
private int GetPostNumber(HtmlNode li)
{
+ string a = li.InnerHtml;
+
+ HtmlDocument htmlDoc = new HtmlDocument();
+ htmlDoc.LoadHtml("<!DOCTYPE html><html><body> " + a + "</body></html>");
+ HtmlNode heu = htmlDoc.DocumentNode;
// Get the primary content of the list item
- HtmlNode? primaryContent = li.GetChildWithClass("primaryContent");
+
+ HtmlNode? primaryContent = heu.GetDescendantWithClass("primaryContent");
// On another branch of the primary content, we can get the post number.
HtmlNode? messageMeta = primaryContent?.GetChildWithClass("messageMeta");
@@ -550,28 +562,7 @@ namespace NetTally.Forums.Adapters2
if (uri == null)
throw new ArgumentNullException(nameof(uri));
- StringBuilder sb = new StringBuilder();
-
- sb.Append(uri.GetLeftPart(UriPartial.Authority));
-
- bool foundThreads = false;
-
- // Add segments up to the thread name.
- for (int i = 0; i < uri.Segments.Length; i++)
- {
- sb.Append(uri.Segments[i]);
-
- if (foundThreads)
- break;
-
- if (uri.Segments[i] == "threads/")
- foundThreads = true;
- }
-
- if (sb[sb.Length - 1] != '/')
- sb.Append('/');
-
- return sb.ToString();
+ return uri.AbsoluteUri;
}
/// <summary>
diff --git a/NetTally.Core/Input/Forums/ForumReader.cs b/NetTally.Core/Input/Forums/ForumReader.cs
index fdc9a75a..1aaa3fe6 100644
--- a/NetTally.Core/Input/Forums/ForumReader.cs
+++ b/NetTally.Core/Input/Forums/ForumReader.cs
@@ -1,13 +1,13 @@
-<EF><BB><BF>using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using HtmlAgilityPack;
+<EF><BB><BF>using HtmlAgilityPack;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NetTally.CustomEventArgs;
using NetTally.Web;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
namespace NetTally.Forums
{
@@ -345,7 +345,9 @@ namespace NetTally.Forums
threadInfo = adapter.GetThreadInfo(page);
}
- postsList.AddRange(adapter.GetPosts(page, quest, pageNumber));
+ IEnumerable<Post> a = adapter.GetPosts(page, quest, pageNumber);
+
+ postsList.AddRange(a);
}
if (incomplete)
@@ -399,7 +401,8 @@ namespace NetTally.Forums
/// <returns>Returns true if the post comes after the start of the tally.</returns>
private bool PostIsAfterStart(Post post, ThreadRangeInfo rangeInfo)
{
- return (rangeInfo.ByNumber && post.Origin.ThreadPostNumber >= rangeInfo.Number) || (!rangeInfo.ByNumber && post.Origin.ID > rangeInfo.ID);
+ bool res =(rangeInfo.ByNumber && post.Origin.ThreadPostNumber >= rangeInfo.Number) || (!rangeInfo.ByNumber && post.Origin.ID > rangeInfo.ID);
+ return res;
}
/// <summary>
@@ -411,7 +414,8 @@ namespace NetTally.Forums
/// <returns>Returns true if the post comes before the end of the tally.</returns>
private bool PostIsBeforeEnd(Post post, IQuest quest, ThreadRangeInfo rangeInfo)
{
- return (quest.ReadToEndOfThread || rangeInfo.IsThreadmarkSearchResult || post.Origin.ThreadPostNumber <= quest.EndPost);
+ bool res= (quest.ReadToEndOfThread || rangeInfo.IsThreadmarkSearchResult || post.Origin.ThreadPostNumber <= quest.EndPost);
+ return res;
}
#endregion
}
diff --git a/NetTally.Core/Input/Web/WebPageProvider.cs b/NetTally.Core/Input/Web/WebPageProvider.cs
index 770f67d5..d62226e7 100644
--- a/NetTally.Core/Input/Web/WebPageProvider.cs
+++ b/NetTally.Core/Input/Web/WebPageProvider.cs
@@ -21,7 +21,7 @@ namespace NetTally.Web
readonly ILogger<WebPageProvider> logger;
const int retryLimit = 3;
- readonly TimeSpan timeout = TimeSpan.FromSeconds(7);
+ readonly TimeSpan timeout = TimeSpan.FromSeconds(40);
readonly TimeSpan retryDelay = TimeSpan.FromSeconds(4);
readonly IGeneralInputOptions inputOptions;