add hint for "bufferapp.com"
This commit is contained in:
@@ -133,11 +133,11 @@ namespace ReadSharp.Ports.NReadability
|
||||
private static readonly Regex _MailtoHrefRegex = new Regex("^\\s*mailto\\s*:", RegexOptions.IgnoreCase);
|
||||
private static readonly Regex _TitleWhitespacesCleanUpRegex = new Regex("\\s+");
|
||||
|
||||
private static readonly Dictionary<Regex, string> _articleContentElementHints =
|
||||
new Dictionary<Regex, string>
|
||||
{
|
||||
{ new Regex("^https?://(www|mobile)\\.theverge.com", RegexOptions.IgnoreCase), ".entry-body" },
|
||||
};
|
||||
private static readonly Dictionary<Regex, string> _articleContentElementHints = new Dictionary<Regex, string>
|
||||
{
|
||||
{ new Regex("^https?://(www|mobile)\\.theverge.com", RegexOptions.IgnoreCase), ".entry-body" },
|
||||
{ new Regex("^https?://(www|blog)\\.bufferapp.com", RegexOptions.IgnoreCase), ".post" }
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
@@ -139,12 +138,14 @@ namespace ReadSharp.Tests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TestVergeReturnsFullArticle()
|
||||
public async Task TestHintUrlsReturnFullArticles()
|
||||
{
|
||||
Article result = await reader.Read(new Uri("http://www.theverge.com/2013/11/18/5116360/nokia-lumia-1520-review"));
|
||||
Debug.WriteLine(result.Content.Length);
|
||||
Assert.Contains("Three years ago, Nokia shipped over 110 million smartphones worldwide. ", result.Content);
|
||||
Assert.True(result.Content.Length > 6000);
|
||||
|
||||
result = await reader.Read(new Uri("http://blog.bufferapp.com/connections-in-the-brain-understanding-creativity-and-intelligenceconnections"));
|
||||
Assert.Contains("The Tweet resulted in over 1,000 retweets", result.Content);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user