diff --git a/website-value/README.md b/website-value/README.md new file mode 100644 index 0000000..e69de29 diff --git a/website-value/website-value.js b/website-value/website-value.js new file mode 100644 index 0000000..02c8736 --- /dev/null +++ b/website-value/website-value.js @@ -0,0 +1,73 @@ +// ==UserScript== +// @name Website Value Checker +// @namespace http://tampermonkey.net/ +// @version 1.0 +// @description Shows the estimated value of the current website in USD +// @author Mitul Patel +// @match *://*/* +// @grant GM_xmlhttpRequest +// @connect www.worthofweb.com +// ==/UserScript== + +(function () { + "use strict"; + + const valueDisplay = document.createElement("div"); + valueDisplay.style.cssText = ` + position: fixed; + bottom: 20px; + left: 20px; + background: rgba(0, 0, 0, 0.8); + color: white; + padding: 15px; + border-radius: 8px; + font-family: Arial, sans-serif; + z-index: 9999; + font-size: 14px; + box-shadow: 0 2px 5px rgba(0,0,0,0.2); + display: flex; + flex-direction: column; + gap: 5px; + `; + valueDisplay.innerHTML = ` +
Checking website stats...
+
Daily earnings: Loading...
+ `; + document.body.appendChild(valueDisplay); + + // Get current hostname + const hostname = window.location.hostname; + + GM_xmlhttpRequest({ + method: "GET", + url: `https://www.worthofweb.com/website-value/${hostname}/`, + onload: function (response) { + // Extract website value and daily earnings + const websiteValue = response.responseText.match(/\$[\d,]+(?:\.\d{2})?/); + const dailyEarnings = response.responseText.match( + /Daily Revenue[\s\S]*?(\$[\d,]+(?:\.\d{2})?)/i + ); + + let valueText = "Not Available"; + let earningsText = "Not Available"; + + if (websiteValue) { + valueText = websiteValue[0]; + } + if (dailyEarnings && dailyEarnings[1]) { + earningsText = dailyEarnings[1]; + } + + valueDisplay.innerHTML = ` +
Est. Website Value: ${valueText}
+
Daily Earnings: ${earningsText}
+ `; + }, + onerror: function () { + valueDisplay.innerHTML = ` +
Error fetching website stats
+
Unable to load data
+ `; + }, + }); +})();