Skip to content

Commit

Permalink
hide ads
Browse files Browse the repository at this point in the history
  • Loading branch information
ksh-b committed Apr 14, 2024
1 parent affb703 commit 9c4fccc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/extractor/general/national/india/theindianexpress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class TheIndianExpress extends Publisher {
if (response.statusCode == 200) {
Document document = html_parser.parse(utf8.decode(response.bodyBytes));
var content = document.querySelector("#pcl-full-content")?.innerHtml ?? "";
var ads = ".osv-ad-class,.ad-slot,.subscriber_hide,.adboxtop,.pdsc-related-modify";
document.querySelectorAll(ads).forEach((ad) {
content = content.replaceAll(ad.innerHtml, "");
},);
var thumbnail = document.querySelector(".custom-caption img")?.attributes["content"];
var excerpt = document.querySelector(".synopsis")?.text;
var timestamp = document.querySelector("span[itemprop=dateModified]")?.attributes["content"];
Expand Down Expand Up @@ -96,7 +100,7 @@ class TheIndianExpress extends Publisher {
timestamp = timestamp.contains("Updated:")?timestamp.split("Updated:")[1].trim():timestamp;
articles.add(NewsArticle(
publisher: this,
title: title ?? "",
title: title,
content: "",
excerpt: excerpt,
author: "",
Expand Down

0 comments on commit 9c4fccc

Please sign in to comment.