बढ़िया!
तुमने "हाँ" कहा, अब मैं तुम्हें GUI वाला simple version बना कर देता हूँ —
मतलब window खुलेगी, उसमें तुम वेबसाइट डालोगे, Button दबाओगे और सारा रिजल्ट सामने आ जाएगा।
(बिना command line इस्तेमाल किए।)
---
ये रहा पूरा Simple GUI Tool का Code:
# Install these libraries first:
# pip install python-whois requests tkinter
import whois
import requests
from datetime import datetime
import tkinter as tk
from tkinter import messagebox
def check_website():
url = entry.get().strip().lower()
if not url:
messagebox.showwarning("Input Error", "Please enter a website.")
return
result_text.delete('1.0', tk.END)
result_text.insert(tk.END, f"Checking website: {url}\n\n")
try:
domain_info = whois.whois(url)
result_text.insert(tk.END, "--- WHOIS Information ---\n")
result_text.insert(tk.END, f"Domain Name: {domain_info.domain_name}\n")
result_text.insert(tk.END, f"Registrar: {domain_info.registrar}\n")
result_text.insert(tk.END, f"Creation Date: {domain_info.creation_date}\n")
result_text.insert(tk.END, f"Expiration Date: {domain_info.expiration_date}\n\n")
try:
response = requests.get('http://' + url, timeout=5)
if response.status_code == 200:
result_text.insert(tk.END, "Website Status: Active (200 OK)\n")
else:
result_text.insert(tk.END, f"Website Status: {response.status_code} (Issue detected)\n")
except:
result_text.insert(tk.END, "Website Status: Unable to reach site.\n")
if domain_info.creation_date:
if isinstance(domain_info.creation_date, list):
creation_date = domain_info.creation_date[0]
else:
creation_date = domain_info.creation_date
domain_age_days = (datetime.now() - creation_date).days
result_text.insert(tk.END, f"Domain Age: {domain_age_days} days\n")
if domain_age_days < 180:
result_text.insert(tk.END, "Risk Alert: New Domain (Less than 6 months old) - Be Cautious!\n")
else:
result_text.insert(tk.END, "Domain looks older than 6 months - Looks safer.\n")
else:
result_text.insert(tk.END, "Creation Date not available - Risky site!\n")
except Exception as e:
result_text.insert(tk.END, f"\nError fetching WHOIS data: {e}")
# GUI Design
root = tk.Tk()
root.title("Website Checker Tool")
# Window Size
root.geometry("600x400")
# Input Field
entry = tk.Entry(root, width=50)
entry.pack(pady=10)
# Check Button
check_button = tk.Button(root, text="Check Website", command=check_website)
check_button.pack(pady=5)
# Text Box for Output
result_text = tk.Text(root, height=20, width=70)
result_text.pack(pady=10)
# Run the window
root.mainloop()
---
कैसे चलाना है?
1. Python install होना चाहिए।
2. ये libraries install कर लो:
pip install python-whois requests
3. tkinter Python में already आता है, अलग से install करने की ज़रूरत नहीं।
4. ऊपर वाला पूरा code एक Python file में डालो।
Example: website_checker_gui.py
5. Run करो:
python website_checker_gui.py
6. एक छोटी Window खुलेगी — वहां वेबसाइट का नाम डालो → Button दबाओ → Result मिल जाएगा!
---
Final Output Window कुछ ऐसा दिखेगा:
ऊपर input box होगा (जहां वेबसाइट डालनी है)
नीचे बड़ा box होगा जिसमें result दिखेगा:
Domain name
Registrar
Creation date
Expiry date
Website live है या नहीं
Domain पुराना है या नया
Risk alert
---
अब अगला step kya chahoge?
इसमे Trust Score (ScamAdviser) भी जोड़ दूँ?
या एकदम professional style का फिनिशिंग दे दूँ
(dark mode, better fonts)?
या फिर तुम इसको EXE file बना कर bina Python के सीधे Windows पर चलाना चाहते हो?
बोलो क्या चाहिए?
(तेज़ी से बना दूंगा!)
0 Comments
Thank You for giving your response