feat: Initial search function

This commit is contained in:
2025-07-18 12:35:09 +10:00
parent 9db2a269a4
commit 330685c03d
4 changed files with 24 additions and 5 deletions

View File

@@ -95,7 +95,6 @@ This isn't done yet but use it over text as it includes parsing
### Plain Text ### Plain Text
Type: `text` Type: `text`
### List ### List
Type: `list` Type: `list`
This is a list if text items (or HTML items) This is a list if text items (or HTML items)

Binary file not shown.

0
account.py Normal file
View File

View File

@@ -48,13 +48,33 @@ def domain_info(params, authentication):
if not domain: if not domain:
return {"info": "No domain provided"} return {"info": "No domain provided"}
response = requests.post(f"https://shakestation.com/api", response = requests.post(f"https://shakestation.io/api",
json={"action":"getTLD","tld":domain}) data={"action":"getTLD","tld":domain})
if response.status_code != 200: if response.status_code != 200:
return {"info": "Failed to fetch data from Shakestation"} return {"info": "Failed to fetch data from Shakestation"}
data = response.json() data = response.json()
return {"info": data}
# Parse info
if "data" not in data:
return {"info": "No data found for the provided domain"}
if "type" not in data["data"]:
return {"info": "No type found in the data"}
domainType = data["data"]["type"]
if domainType == "marketplace":
score = data["data"].get("score", "No score available")
price = data["data"].get("price", "No price available")
return {"info": f"Domain is listed on Shakestation with score {score} and price {price}"}
return {"info": "TODO"}
return {"info": f"TODO: {domainType} domain type not implemented yet. Data: {data}"}
if __name__ == "__main__":
# Example usage
params = {"domain": "pinwheelgalaxy"}
authentication = None # Replace with actual authentication if needed
result = domain_info(params, authentication)
print(json.dumps(result, indent=2))