(function (w, d) { w.tsUpdateMetaDescription = function () { var existingTitle = document.querySelector('title').innerText; document.querySelector('title').innerText = " Rating: 0.0 - 0 Reviews - " + existingTitle; var existingDesc = document.querySelector('meta[name="description"]').getAttribute("content"); document.querySelector('meta[name="description"]').setAttribute("content", " Rating: 0.0 - 0 Reviews - " + existingDesc); }; var timestamp = document.createElement("meta"); timestamp.setAttribute("name", "ts-timestamp"); timestamp.setAttribute("content", new Date().toLocaleString()); document.head.appendChild(timestamp); if (d.getElementById("ts-json") === null) { var filter = Array.prototype.filter; var productName = "Pestforce Stirling"; var title = document.querySelector("title"); if (title === null || title.innerText.match(/^ *$/) !== null) { title = filter.call(d.querySelectorAll('h1'), function (node) { return node.innerText != ""; })[0]; } if (typeof title !== "undefined") { productName = title.innerText; } var json = ""; var a = d; var c = a.createElement("script"); c.type = 'application/ld+json'; c.id = 'ts-json'; c.innerText = json .replace(new RegExp("{{url}}", 'g'), w.location.href) .replace("\"{{productName}}\"", JSON.stringify(productName).replace(/[^ -~]+/g, "")); a = a.getElementsByTagName("head")[0]; a.appendChild(c); } var s = document.createElement('script'); s.type = 'text/javascript'; s.defer = true; s.src = 'https://widget.trustist.com/Zw6Tb2nPsUWOBKkOcYUTYw/ratingsummary.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })(window, document);