commit 431bde4e440dddb1a809863a4adceb00b59e26d7 Author: Bryan Cerrati Date: Tue Mar 4 12:48:31 2025 -0500 Initial Commit diff --git a/app.py b/app.py new file mode 100644 index 0000000..b363ae1 --- /dev/null +++ b/app.py @@ -0,0 +1,33 @@ +from flask import Flask, render_template, request, redirect, url_for +import whois + +app = Flask(__name__) + +# In-memory list to store domain info. In production, you’d use a database. +domains = [] + +@app.route('/') +def home(): + return render_template('home.html', domains=domains) + +@app.route('/add', methods=['GET', 'POST']) +def add_domain(): + if request.method == 'POST': + # Get a list of domains from the form (one or multiple) + domain_list = request.form.getlist('domain') + for domain in domain_list: + if domain.strip(): # ignore empty strings + try: + w = whois.whois(domain) + # Some WHOIS responses return a list of dates. + exp_date = w.expiration_date + if isinstance(exp_date, list): + exp_date = exp_date[0] + except Exception as e: + exp_date = f"Error: {e}" + domains.append({'domain': domain, 'expiration_date': exp_date}) + return redirect(url_for('home')) + return render_template('add_domain.html') + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5050, debug=True) diff --git a/templates/add_domain.html b/templates/add_domain.html new file mode 100644 index 0000000..61d313f --- /dev/null +++ b/templates/add_domain.html @@ -0,0 +1,33 @@ + + + + + Add Domain + + + +

Add Domain(s)

+
+
+ +
+
+ +

+ +
+
+ Back to Home + + diff --git a/templates/home.html b/templates/home.html new file mode 100644 index 0000000..b8091ed --- /dev/null +++ b/templates/home.html @@ -0,0 +1,28 @@ + + + + + Domain List + + +

Domain List

+ + + + + + + + + {% for domain in domains %} + + + + + {% endfor %} + +
DomainExpiration Date
{{ domain.domain }}{{ domain.expiration_date }}
+
+ Add Domain + +