Charles Lee

Blog Posting Enabled via API

Created: 2024-11-18

Updated: 2024-11-18

Created: 2024-11-18 15:57

Updated: 2024-11-18 23:27

Durumis Weaknesses:

- Very poor EDIT function.

- Does not support Markdown.

- Does not support writing using the API.


Many blog services provide the ability to upload posts through an API. The main services and their API functions are as follows:

Google Blogger:

Google's Blogger platform officially provides the Blogger API, supporting functions such as creating, modifying, and deleting posts. This allows developers to manage blog content through programs.
THE SEE
Tistory:

Tistory officially provides an Open API that supports creating, modifying, and deleting blog posts. This allows developers to manage blog content through programs.
WordPress:

WordPress provides functions for creating, modifying, and deleting posts through the REST API. This allows developers to manage blog content through programs.


WordPress.com: A convenient platform with included hosting; you can start a blog immediately after signing up.
WordPress.org: Requires setting up your own hosting and offers a higher level of freedom and customization.


WordPress Markdown Support

WordPress Additional Plugins: If you want more Markdown features, consider the following plugins:

Markdown Editor: Replaces the default editor with a Markdown editor, providing real-time preview and various layout options.

Import Markdown: Allows you to import external Markdown files and convert them into posts.


I tried to write on wordpress.com, but found a problem. It seemed that it would only be meaningful if it was paid.

So, I searched again.


Tistory emerged as a good alternative. It provides an openAPI, and ChatGPT also provides an answer.



Tistory OpenAPI Preparation

Issuing an API Key: Tistory management page → 'Plugin' → 'Open API' to issue an API Key.

Obtaining a User Authentication Token: The Tistory API uses OAuth2. Follow the OAuth authentication process to obtain a user authentication token.

Necessary API Information: Request URL: https://www.tistory.com/apis/post/write

Essential Parameters:

  • access_token: Issued authentication token
  • blogName: Blog name
  • title: Post title
  • content: Post content

Tistory

  • Very poor EDIT function: Using openAPI
  • Does not support Markdown: Convert markdown to html in Python and upload
  • Does not support writing using the API: Supports openAPI

chatgpt prompt: Write a python code that uploads one article to tstory using openAPI. Create an example that uploads markdown.

python print("Hello, Markdown!")



Research Purpose

Upload markdown files to github.

The python code uploads each markdown file in github to tistory.

At this time, what needs to be investigated is how to use png files and how to upload the contents when using the markdown2 package.

  • To upload image files (PNG, JPEG, etc.) using the Tistory (Tistory) OpenAPI, use the post/attach API. When you upload an image, the image URL is returned, which can be used when writing a post.

Comments0