[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
This commit is contained in:
argiro.kokogiannaki 2021-03-18 15:19:22 +00:00
parent 4ec2c7c124
commit eb314179d3
1 changed files with 7 additions and 4 deletions

View File

@ -647,11 +647,15 @@ export class ResultLandingComponent {
|| (this.resultLandingInfo.supplementedByResearchResults && this.resultLandingInfo.supplementedByResearchResults.length > 0) || (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 && !( 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.publisher == "Zenodo" ||
this.resultLandingInfo.hostedBy_collectedFrom.filter( value => {return value.downloadName && value.downloadName.toLowerCase().indexOf("zenodo")!=-1}).length > 0)); this.resultLandingInfo.hostedBy_collectedFrom.filter( value => {return value.downloadName && value.downloadName.toLowerCase().indexOf("zenodo")!=-1}).length > 0));
if(!allow) { if(!allow) {
this._meta.updateTag({content: 'noindex'}, "name='robots'"); this._meta.updateTag({content: 'noindex'}, "name='robots'");
} }
@ -661,8 +665,7 @@ export class ResultLandingComponent {
return false; return false;
} }
} }
private hasKeyword(value:string){ private hasKeyword(value:string, words:string[]){
let words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty"];
return words.filter( word => { return value.indexOf(word)!=-1}).length > 0; return words.filter( word => { return value.indexOf(word)!=-1}).length > 0;
} }
} }