From eb314179d3ac7cab4b8a861d093266c356716007 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 18 Mar 2021 15:19:22 +0000 Subject: [PATCH] [Library|Trunk] SEO: update list of words for no-index filter add check about abstract git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60668 d315682c-612b-4755-9ff5-7f18f6832af3 --- landingPages/result/resultLanding.component.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index a84df41e..54a4e80b 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -647,11 +647,15 @@ export class ResultLandingComponent { || (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0) ) ); + //words to exclude + let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "TUBYDI"]; + let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"]; allow = allow && !( - (this.hasKeyword(this.resultLandingInfo.title.toLowerCase()) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.join(" ").toLowerCase()))) && + (this.hasKeyword(this.resultLandingInfo.title.toLowerCase(),title_authors_words) || (this.resultLandingInfo.authors && this.hasKeyword(this.resultLandingInfo.authors.join(" ").toLowerCase(),title_authors_words)) + || (this.resultLandingInfo.description && this.hasKeyword(this.resultLandingInfo.description.toLowerCase(),abstract_words)) + ) && (this.resultLandingInfo.publisher == "Zenodo" || this.resultLandingInfo.hostedBy_collectedFrom.filter( value => {return value.downloadName && value.downloadName.toLowerCase().indexOf("zenodo")!=-1}).length > 0)); - if(!allow) { this._meta.updateTag({content: 'noindex'}, "name='robots'"); } @@ -661,8 +665,7 @@ export class ResultLandingComponent { return false; } } - private hasKeyword(value:string){ - let words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty"]; + private hasKeyword(value:string, words:string[]){ return words.filter( word => { return value.indexOf(word)!=-1}).length > 0; } }