SWDesk/Web

[Tistory] Uploading Image File

inhae 2021. 8. 8. 16:50

 

def Test_Tistory01(): # 2021.08.08
    titleString = "Test023-210808"
    contentString1 = 'test023-content'

    filePathname = "./20210604_133628.png"
    #filePathname = "./CodeList_Street11.xlsx" # Only IMAGE
    param1 = {
        'title': titleString,
        'content': contentString1,
        'output': "json",
        'FilePathname': filePathname
    }
    ti1 = cTistoryAPI()
    responseText = ti1.UploadFile(param1)
    resJson = json.loads(responseText)
    resStatus = resJson['tistory']['status']
    resURL = resJson['tistory']['url']
    resReplacer = resJson['tistory']['replacer']

    param1['content'] = resReplacer    
    ti1.UploadArticle(param1)

수동으로하면 아래와 같다.

 

<"HTML" 선택>

 

 

<HTML 편집 화면>

 

<'Replacer' 입력>

<게시된 글>

반응형