-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
23 lines (16 loc) · 772 Bytes
/
example.py
File metadata and controls
23 lines (16 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from dogbin import Dogbin
import asyncio
deldog = Dogbin()
# paste to de.dog
url = deldog.paste("some text...") # sync
print(url)
Aync = asyncio.run(deldog.Async_paste("some text...")) # async
print(Aync)
# get paste from del.dog
by_url = deldog.get_paste('https://del.dog/atacopegno') # sync
# save the paste in file
by_key = deldog.get_paste('atacopegno', save_to_file=True) # sync
print(f'getting this paste by url {by_url}\n\ngetting this paste by key {by_key}')
async_url = asyncio.run(deldog.Async_getpaste('https://del.dog/atacopegno', save_to_file=False)) # async
async_key = asyncio.run(deldog.Async_getpaste("atacopegno")) # async
print(f'getting this paste by url:\t {async_url}\n\ngetting this paste by key:\t {async_key}')