d44d33110442a7e70b5c6be917662604f931973b
1 package be
.nikiroo
.gofetch
.support
;
3 import java
.io
.IOException
;
5 import java
.util
.AbstractMap
;
6 import java
.util
.ArrayList
;
8 import java
.util
.Map
.Entry
;
10 import org
.jsoup
.nodes
.Document
;
11 import org
.jsoup
.nodes
.Element
;
12 import org
.jsoup
.nodes
.Node
;
15 * Support <a href="https://www.7sur7.be/">https://www.7sur7.be/</a>.
19 public class SeptSurSept
extends BasicSupport
{
21 public String
getDescription() {
22 return "7SUR7.be Info, sport et showbiz, 24/24, 7/7";
26 public void login() throws IOException
{
27 addCookie("pwrefr2", "");
28 addCookie("pwv-atXMVFeyFP1Ki09i", "1");
29 addCookie("pwg-atXMVFeyFP1Ki09i", "basic");
31 addCookie("pwv", "1");
32 addCookie("pw", "functional");
34 URL url
= new URL("https://www.7sur7.be/7s7/privacy/callback.do"
35 + "?redirectUri=/" + "&pwv=1" + "&pws=functional%7Canalytics"
36 + "&days=3650" + "&referrer=");
42 protected List
<Entry
<URL
, String
>> getUrls() throws IOException
{
43 List
<Entry
<URL
, String
>> urls
= new ArrayList
<Entry
<URL
, String
>>();
44 URL url
= new URL("https://www.7sur7.be/");
45 urls
.add(new AbstractMap
.SimpleEntry
<URL
, String
>(url
, ""));
51 protected List
<Element
> getArticles(Document doc
) {
52 return doc
.getElementsByClass("clip");
56 protected String
getArticleId(Document doc
, Element article
) {
57 String id
= article
.attr("id");
58 if (id
!= null && id
.startsWith("clip")) {
59 return id
.substring("clip".length());
66 protected String
getArticleTitle(Document doc
, Element article
) {
67 return article
.attr("data-title");
71 protected String
getArticleAuthor(Document doc
, Element article
) {
76 protected String
getArticleDate(Document doc
, Element article
) {
77 return article
.attr("data-date");
81 protected String
getArticleCategory(Document doc
, Element article
,
82 String currentCategory
) {
83 Element parent
= article
.parent();
85 Element catElement
= parent
.previousElementSibling();
86 if (catElement
!= null) {
87 return catElement
.text();
95 protected String
getArticleDetails(Document doc
, Element article
) {
100 protected String
getArticleIntUrl(Document doc
, Element article
) {
101 return article
.absUrl("href");
105 protected String
getArticleExtUrl(Document doc
, Element article
) {
110 protected String
getArticleContent(Document doc
, Element article
) {
111 return article
.attr("data-intro").trim();
115 protected Element
getFullArticle(Document doc
) {
116 return doc
.getElementById("detail_content");
120 protected ElementProcessor
getElementProcessorFullArticle() {
121 return new BasicElementProcessor() {
123 public boolean ignoreNode(Node node
) {
124 return node
.attr("class").equals("read_more")
125 || "teas_emopoll".equals(node
.attr("id"))
126 || "teas_emopoll_facebook".equals(node
.attr("id"))
127 || "soc_tools".equals(node
.attr("id"));
131 public String
isSubtitle(Node node
) {
132 if (node
instanceof Element
) {
133 Element element
= (Element
) node
;
134 if (element
.tagName().equals("strong")) {
135 return element
.text();
144 protected List
<Element
> getFullArticleCommentPosts(Document doc
, URL intUrl
) {
149 protected List
<Element
> getCommentCommentPosts(Document doc
,
155 protected String
getCommentId(Element post
) {
160 protected String
getCommentAuthor(Element post
) {
165 protected String
getCommentTitle(Element post
) {
170 protected String
getCommentDate(Element post
) {
175 protected Element
getCommentContentElement(Element post
) {
180 protected ElementProcessor
getElementProcessorComment() {