import os import httpx from typing import Optional AFFILIATE_LINKS = { "hostinger": { "full": "https://www.hostinger.com?REFERRALCODE=FCIHARY08HBD", "short": "https://tinyurl.com/jarvis-hostinger", "description": "Web Hosting Terbaik & Termurah", "commission": "~$60-100 per sale", "cookie": "30 days" }, "shopee": { "full": "https://shopee.co.id", "short": "https://tinyurl.com/jarvis-shopee", "description": "Belanja Online Terpercaya", "commission": "2-10% per sale", "cookie": "7 days" } } LINK_TEMPLATES = { "hostinger": [ "Mau bikin website tapi bingung mulai dari mana? Coba Hostinger! 👉 {link}", "Tips hemat: beli hosting di Hostinger, harganya murah banget! {link}", "Website profesional gak harus mahal! Hostinger solusinya 🚀 {link}", "Domain + Hosting bundling murah di Hostinger! {link}", "Udah ribuan orang Indonesia pakai Hostinger! Mau coba? 👉 {link}" ], "shopee": [ "Produk ini lagi viral di Shopee dan harganya murah! 👉 {link}", "Belanja hemat di Shopee, gratis ongkir! {link}", "Promo terbatas! Diskon gede di Shopee hari ini 🔥 {link}", ] } def get_link(platform: str, short: bool = True) -> str: if platform not in AFFILIATE_LINKS: return "" return AFFILIATE_LINKS[platform]["short" if short else "full"] def get_random_template(platform: str) -> str: import random if platform not in LINK_TEMPLATES: return "" template = random.choice(LINK_TEMPLATES[platform]) return template.format(link=get_link(platform)) def get_all_links() -> dict: return AFFILIATE_LINKS