#!/usr/bin/env python """Utilize crypto domains DNS and either redirect, or display information.""" from bottle import Bottle, run, response, request import json import requests import json2html VERSION = '0.0.1' app = Bottle() def domainLookup(domain): apibase = 'https://unstoppabledomains.com/api/v1/' dnslookup = requests.get(apibase + domain) domainJSON = json.loads(dnslookup.content) print(domainJSON) return domainJSON @app.route("/") def root(): host = request.get_header('host') helptext = f"""
General format is {host}/<domain>/<action>
If <action> is blank, it will attempt to use the IPFS hash
You may also/optionally specify an action which can be any of the following
raw | Show the raw json (formatted as an html table) |
html | Hit the IPFS hash via cloudflare-ipfs.com |
redir | Use the redirect parameter and just return a 302 redirect to whatever is set |