10cbazbt3.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:10cbazbt3 作者: bazbt3 项目源码 文件源码
def replyinline(postidreply, poster):
    # Use the to-be-replied-to post id:
    replytoid = postidreply
    replytoposter = poster
    # Input some text:
    posttext = input(Fore.YELLOW + Style.DIM + "Write some text: " + Style.RESET_ALL)
    # Add '@', username to posttext:
    posttext = ("@" + replytoposter + " " + posttext)
    # Saves the input text to 'posttext.txt':
    file = open("posttext.txt", "w")
    file.write(posttext)
    file.close()
    # Uses the global header & creates the data to be passed to the url:
    url = 'https://api.10centuries.org/content'
    data = {'reply_to': replytoid, 'content': posttext}
    response = requests.post(url, headers=headers, data=data)
    # Displays the server's response:
    responsestatus = response.status_code
    showapiresponse(responsestatus)


# Define the 'repostinline' subroutine:
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号