(function() {
const TARGET_URL = "https://ons.ir/gold-ounce-live/";
const selectors = {
dollar: #post-1666 > div > section.wd-negative-gap.elementor-section.elementor-top-section.elementor-element.elementor-element-a539559.elementor-section-boxed.elementor-section-height-default.elementor-section-height-default > div > div.elementor-column.elementor-col-50.elementor-top-column.elementor-element.elementor-element-e70f26e > div > div > div > div > div.tgju-widget > table > tbody > tr:nth-child(1) > td:nth-child(1) > div
const links = {
یورو: "https://ons.ir/dollar/", // یا آدرس مخصوص یورو
"انس طلا": TARGET_URL
};
const observer = new MutationObserver(() => {
Object.keys(selectors).forEach(key => {
const selector = selectors[key];
const elements = document.querySelectorAll(selector);
elements.forEach(element => {
if (element.dataset.linked) return;
const text = element.textContent.trim();
if (!text || !links[text]) return;
const link = document.createElement("a");
link.href = links[text];
link.textContent = text;
link.style.color = "#0d47a1";
link.style.fontWeight = "bold";
link.style.textDecoration = "none";
link.style.cursor = "pointer";
element.innerHTML = '';
element.appendChild(link);
element.dataset.linked = "true";
});
});
});
observer.observe(document.body, {
childList: true,
subtree: true
});
})();