-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
It's not an issue, I just want to share this code
from telegraph import Telegraph, upload
telegraph = Telegraph()
telegraph.create_account(short_name='LetsTry')
def post(title, content):
response = telegraph.create_page(title,
html_content = content)
return 'https://telegra.ph/{}'.format(response['path'])
files = '/Users/vovkapultik/Downloads/52920087_159420908268041_6560105268061929472_n.jpg'
imgpath = upload.upload_file(files)
print(imgpath)
#['/file/02a1613fc106b225b2b74.jpg']
postlink = post('Title', '<img src="/file/02a1613fc106b225b2b74.jpg">')
print(postlink)bralbral, Tweetus-Bot, 4amparaboy, LEGION128, ModChino and 4 more
Metadata
Metadata
Assignees
Labels
No labels