jsup 2.1 - "저녁이 있는 스팀" 실험

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-2-1 휴일도 주말도 없이 매일 포스팅하느라 남의 글 읽을 여유도 없고, 뭘 써야 하나 쥐어짜면서 재미도 없어지고 이런 상황이 반복되면서 스팀 커뮤니티도 퇴색하고 포스트 품질도 하향평준화되고 있는 것은 아닐까, 그런 생각을 예전부터 했습니다. 임대 셀프보팅이 언뜻 보기에는 수익률이 높은 것 같지만, 어쩌면 스팀의 재미를 심각하게 반감시키고 신규 사용자/투자자 유입을 저하시키면서 스팀 시세 자체를 추락시키는 심각한 요인이 되고 있는지도 모릅니다. 이 문제에 대한 대응 차원에서 투자와 소셜 플랫폼 기능을 분리하는 실험을 해 보려고 합니다. 1일1포스팅의 의무감에서 벗어나 좀 더 여유 있고 편안한 스팀 생활을 위한 jsup 2.1 - "저녁이 있는 스팀" 실험입니다. 스팀에 투자는 했지만 현생에 바쁘거나, 또는 글쓰기에 취미가 없는데 휴일/공휴일도 없는 1일1포스팅 때문에 스팀이 즐거움이 아니라 부담이 되어버린 경우에 한번 고려해 볼 만하다고 생각됩니다. 또한, 글쓰기에 전혀 취미가 없는 사람에게도 투자 관점에서 스팀 매수/파워업을 추천할 수 있는 여건이 될 수도 있지 않을까, 그런 생각도 듭니다. 오로지 보팅 때문에 어쩔 수 없이 매일 작성하는, 아무도 읽지 않는 한줄짜리 포스팅은 이제 과거의 추억으로 보내고, 부담 없는 편안한 마음으로 스팀에 투자하고 정말 기록하고 싶은 내용이 있을 때 정성 들여 포스팅하는 그런 스팀 생활이 가능해야 합니다. 그래서 내가 쓴 포스트를 다른 사람들이 와서 기꺼이 읽고, 나도 다른 사람들이 쓴 포스트를 궁금해 하는, 그런 스팀 생활이 가능해야 합니다. 친구들과 술 한잔을 해도, 여행을 가도, 출장을 가도, 명절에 가족들과 윷놀이를 하고 이야기꽃을 피우면서도, 마치 12시 종이 치기 전에 집으로 돌아가야 하는 신데렐라처럼 마음 한구석에서 포스팅 걱정을 해야...

[EN] jsup-blog experiment: access token for Google Blogger

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/en-jsup-blog-experiment-access-token-for-google-blogger


jsup-blog experiment: bridge between Steemit & Google Blogger

To use Google Blogger API, an access token must be issued via protocol called "OAuth 2.0". You get "OAuth client ID" and then generate "credentials.json" file. Of course you must have a Google blog.

The procedure is as follows.

Sign to your Google Account with using a web browser, and then go to Blogger section of Google for Developers page. Check the link below:

Blogger API: Using the API

You will see a blue button labeled as "Get an OAuth client ID". Click it, and then select "Create a new project".

blogger_api_01.jpg

Specify project name and prduct name. Set category as "Desktop App". Then click "CREATE" button.

blogger_api_02.jpg

blogger_api_03.proc.jpg

blogger_api_04.jpg

API setting is complete. Now click "DOWNLOAD CLIENT CONFIGURATION" button to download credentials.json file.

blogger_api_05.proc.jpg

Now, you need to generate token file for @jsup service. This procedure requires python installed.

First, install python modules for Google API with the following command:

pip3 install google-api-python-client

pip3 install google-auth-oauthlib

Make a python script and save it in the directory which contains credentials.json file. Use the following python code and save the script as get_token.py.

import pickle
from pathlib import Path
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow

SCOPES = ['https://www.googleapis.com/auth/blogger']    
client_sec = 'credentials.json'

if Path(client_sec).exists():
    print("found:", client_sec)
else:
    print("ERROR:", client_sec, "NOT FOUND!")
    exit()

creds = None
if Path("auto_token.pickle").exists():
    with open('auto_token.pickle', 'rb') as token:
        creds = pickle.load(token)
if not creds or not creds.valid:
    if creds and creds.expired and creds.refresh_token:
        print("trying to refresh token")
        creds.refresh(Request())
    else:
        flow = InstalledAppFlow.from_client_secrets_file(client_sec, SCOPES)
        creds = flow.run_local_server(port=0)
    print("saving auto_token.pickle")
    with open('auto_token.pickle', 'wb') as t:
        pickle.dump(creds, t)
else:
    print("OK: valid pickle file")

Run the script with the following command:

python3 get_token.py

The script will launch web browser, and you will be asked to grant access for the cliend ID. Allow access to generate auto_token.pickle file.

@jsup service needs this token file to connect with Google Blogger. I'm planning to receive the file via email and manually register it with @jsup service.


@joviansummer's STEEM projects

@jswit witness project:
I'm running a STEEM witness node. I'd really appreciate it if you vote for my witness account @jswit. (https://steemitwallet.com/~witnesses)
[ENG] Introducing @jswit witness project

@jsup curation project:
[ENG] Introduction to @jsup curation project
[ENG] Using @jsup curation project as an auto-voting agent
[ENG] jsup 2.0 - make your upvote great again

jSTEEM project:
jSTEEM project - STEEM blockchain explorer on Telegram messenger

STEEM.NFT project:
STEEM.NFT - Preserve your art on Steemit & IPFS

Steemit-Search project:
Steemit-Search: a simple website for post searching

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기