Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added website-value/README.md
Empty file.
73 changes: 73 additions & 0 deletions website-value/website-value.js
Original file line number Diff line number Diff line change
@@ -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 = `
<div>Checking website stats...</div>
<div style="font-size: 12px; color: #aaa;">Daily earnings: Loading...</div>
`;
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 = `
<div>Est. Website Value: ${valueText}</div>
<div style="font-size: 12px; color: #aaa;">Daily Earnings: ${earningsText}</div>
`;
},
onerror: function () {
valueDisplay.innerHTML = `
<div>Error fetching website stats</div>
<div style="font-size: 12px; color: #aaa;">Unable to load data</div>
`;
},
});
})();