generated from nathanwoodburn/firewallet-plugin-template
60 lines
1.4 KiB
Python
60 lines
1.4 KiB
Python
import json
|
|
import account
|
|
import requests
|
|
|
|
# Plugin Data
|
|
info = {
|
|
"name": "Shakestation",
|
|
"description": "Connect to Shakestation",
|
|
"version": "1.0",
|
|
"author": "Nathan.Woodburn/"
|
|
}
|
|
|
|
# Functions
|
|
functions = {
|
|
"main":{
|
|
"name": "Function name",
|
|
"type": "default",
|
|
"description": "Description",
|
|
"params": {},
|
|
"returns": {
|
|
"status":
|
|
{
|
|
"name": "Status of the function",
|
|
"type": "text"
|
|
}
|
|
}
|
|
},
|
|
"domain_info": {
|
|
"name": "Domain info",
|
|
"type": "search",
|
|
"description": "Check if Shakestation has information on a domain",
|
|
"params": {},
|
|
"returns": {
|
|
"info":
|
|
{
|
|
"name": "Shakestation information",
|
|
"type": "text"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
def main(params, authentication):
|
|
return {"status": "Success"}
|
|
|
|
def domain_info(params, authentication):
|
|
domain = params.get("domain")
|
|
if not domain:
|
|
return {"info": "No domain provided"}
|
|
|
|
response = requests.post(f"https://shakestation.com/api",
|
|
json={"action":"getTLD","tld":domain})
|
|
if response.status_code != 200:
|
|
return {"info": "Failed to fetch data from Shakestation"}
|
|
data = response.json()
|
|
return {"info": data}
|
|
|
|
|
|
|
|
return {"info": "TODO"} |