This file contains hidden or 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
const couponElements = document.getElementsByTagName('sov-nexus-coupon-list')[0].children; | |
const searchString = ''; | |
for (var coupon of couponElements) { | |
const name = coupon.querySelectorAll('.coupon-content .info span.ng-star-inserted')[0].innerText.toLowerCase(); | |
const logoName = coupon.querySelectorAll('.coupon-logo img')[0].getAttribute('alt').toLowerCase(); | |
if (name.indexOf(searchString) !== -1 || logoName.indexOf(searchString) !== -1) { | |
console.log(logoName, name, coupon); | |
} |
This file contains hidden or 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
/** | |
* Schneidet einen String nach x Zeichen ab und zeigt ihn mit ... ab Ende an | |
* Achtet dabei auf eine sinnvolle Wort Trennung ab dem nächsten Leerzeichen | |
* | |
* @param {array} params der input text | |
* @param {array} params Die Länge ab wann abgeschnitten werden soll | |
* @return {string} | |
*/ | |
const [text, len] = params; |