NewGen

Try the Tistory Open API on Git 본문

About APIs

Try the Tistory Open API on Git

Deep Learning 2019. 2. 15. 09:58

Try the Tistory Open API on Git



Tistory currently has sample code for OpenAPI on Github. I recently visited some sample code in the app and found an interesting Commit.


https://github.com/tistory/document-tistory-apis



If you look at the commit history of your master branch, you can think of it as a hot API document with a repository that started on August 1st of this year. It looks like you're still writing



You can go in and view this link, and you are still guided through the implementation of the OAuth related authentication APIs.


However, you will still be able to see the certification article in the Tistory guide menu.


GitBook is more readable in terms of readability, so it would be nice to see it cleaned up and finished.



Tistory has an address for each post. You can set the number in alphabetical or numerical form in the settings. However, when I decided by numbers, post analytics results of Google Analytics were listed by number in the address. It is troublesome to check every posting in the address window every time I try to download a list of articles by using the Tistory Open API.


The screen just above is the post statistics by Google Analytics. I do not know what post it is because it is a number.


Today I want to get the authentication code of the first priority OPEN API using Python.


To use the Tistory Open API, you must first register the client.


https://tistory.github.io/document-tistory-apis/



You can access and register the Tistory Open API site (http://www.tistory.com/guide/api/oauth). I have already registered one service name under test. When you register, you can get the client ID and secret key.



Instead, you receive an access_token when you receive a certificate from Tistory, and the value comes back in the address bar. I need to enter the address to return this value on the configuration screen, but I just made it my tistory blog address. However, it does not matter if you just put the Tistory address.






Now the configuration is over. I do not need to use Python to get the authorization code, but I have tried to get the authorization code by taking the list of posts later.



The order is as follows. First, add client ID after client registration and connect to web browser. The address is the address corresponding to the url above. If you are logged in to the Tistory blog, you will be returned with the access_token in the address bar after login.


The next thing to do is to enter the address, truncate the text, leaving only the access_token.



Now that you have access_token, you can use the registry open API through the code. In the following post, I used this to download the list of the list. Please see the posting below for details.



Comments