forked from CustomIcon/nekobinpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.py
32 lines (27 loc) · 921 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from nekobin import NekoBin, errors
import asyncio
nekobin = NekoBin()
async def main():
try:
neko = await nekobin.nekofy(
content="Hello World",
title="example", # Optional
author="pokurt" # Optional
)
except errors.HostDownError:
return print("Host is down at the moment")
output = "Nekofy Content:\n-----------\n"
output += "Key: " + neko.key + "\n"
output += "URL: " + neko.url + "\n"
output += "Raw URL: " + neko.raw + "\n"
if neko.title:
output += "Title: " + neko.title + "\n"
if neko.author:
output += "Author: " + neko.author + "\n"
output += "Date: " + str(neko.date) + "\n"
output += "Views: " + str(neko.views) + "\n"
output += "Length: " + str(neko.length) + "\n"
output += "Content: " + neko.content + "\n"
print(output)
if __name__ == "__main__":
asyncio.run(main())