-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #5 url is not used as a date hint anymore
- Loading branch information
dj
committed
May 24, 2018
1 parent
7e63723
commit 100b352
Showing
3 changed files
with
946 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
parser/src/test/java/lt/tokenmill/crawling/parser/AljazeeraExtractorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package lt.tokenmill.crawling.parser; | ||
|
||
import lt.tokenmill.crawling.data.HttpArticle; | ||
import lt.tokenmill.crawling.data.HttpSource; | ||
import org.junit.Test; | ||
|
||
import java.util.Arrays; | ||
|
||
import static junit.framework.TestCase.assertEquals; | ||
|
||
public class AljazeeraExtractorTest extends BaseArticleExtractorTest { | ||
|
||
@Test | ||
public void testFortune2() throws Exception { | ||
String html = loadArticle("aljazeera1"); | ||
String url = "https://www.aljazeera.com/news/2018/05/2000-jewish-settlers-storm-al-aqsa-setting-record-180513161200107.html"; | ||
HttpArticle article = ArticleExtractor.extractArticle(html, url, getSourceConf(), null); | ||
assertEquals("2018-05-13T00:00:00.000Z", article.getPublished().toInstant().toString()); | ||
} | ||
|
||
private HttpSource getSourceConf() { | ||
HttpSource source = new HttpSource(); | ||
source.setDateSelectors(Arrays.asList(".article-duration")); | ||
return source; | ||
} | ||
|
||
} |
Oops, something went wrong.