GentBG x PUSSTEEM - burning both STEEM and PUSS

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/gentbg-x-pussteem-burning-both-steem-and-puss Hello, this is @joviansummer(witness: @jswit), developer of GentBG project. I registered @gentbg account to PUSSTEEM about a week ago and donated some of my own PUSS token to @gentbg's EPUSS account. Now, @gentbg will burn STEEM and EPUSS at the same time. PUSSTEEM's boosting upvotes will help increasing baseline burning significantly. @gentbg's SP reward is delegate to @jsup to get automated upvotes, forming a baseline burning of liquid reward independent of other people's upvotes. Some may argue 100%(both liquid and SP reward) burning is much better, but I chose this approach to prevent @gentbg from becoming a spamming account. Constantly asking for upvotes via mentioning and commenting every week may eventually become a big annoyance to curators. That being said, anyone is welcome to participate in countering STEEM inflation by giving upvotes ...

파이썬 beem에서 특정 포스트의 이미지와 태그 확인하기

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/21zrt3-beem


사람은 포스트 내용을 보고 이미지와 태그가 있는 것을 즉각적으로 알지만, 프로그램이 포스트에서 이미지와 태그를 확인하려면 포스트 데이터에 포함된 json_metadata라는 항목을 이용해야 합니다.

파이썬 beem에서 특정 포스트에 이미지가 있는지 없는지 간편하게 판별할 수 있습니다. Comment 객체를 이용해서 대상 포스트의 데이터를 가져온 후, 딕셔너리(dict) 형식으로 제공되는 json_metadata 항목에 "image"라는 키(key)가 있는지 확인하면 됩니다. 대상 포스트는 오소펌(authorperm)으로 식별합니다.

아래와 같이 해 볼 수 있겠습니다. 스팀 기준입니다.

from beem import Steem
from beem.comment import Comment

node_list = ["https://api.steemit.com"]

steem = Steem(node=node_list)

authorperm = "joviansummer/pfpzd-jsteem-ops"

comment = Comment(authorperm, blockchain_instance=steem)

# comment['json_metadata'] 딕셔너리 키(key)에 "image"가 포함되어 있는지 확인
if 'image' in comment['json_metadata']:
  print("포스트에 이미지가 포함되어 있습니다. 이미지 url은 아래와 같습니다")
  for img_url in comment['json_metadata']['image']:
    print(img_url)
else:
  print("포스트에 이미지가 포함되어 있지 않습니다.")

이미지 url 목록은 comment['json_metadata']['image']에 리스트(list) 형태로 제공됩니다. 따라서 위의 예시처럼 for 반복문으로 이미지 url을 차례로 출력할 수 있습니다.

포스트에 포함된 태그(tag) 목록도 json_metadata에 있습니다. 따라서, 위의 코드를 응용해서 포스트에 특정 태그가 포함되어 있는지 판별할 수도 있습니다. 위의 예시에서 태그 목록은 리스트(list) 형식으로 comment['json_metadata']['tags']에 할당되어 있습니다. 아래와 같은 코드로 태그 목록을 출력할 수 있을 것입니다.

for tag in comment['json_metadata']['tags']:
  print(tag)

포스트 식별자로 사용되는 오소펌과 펌링크(permlink) 관련 내용은 이전 포스팅을 참고하시기 바랍니다. 아래의 링크입니다.

펌링크(permlink) 관련 내용 간략하게 정리


@joviansummer의 스팀 프로젝트

스팀 증인노드를 운영중입니다. @jswit에 증인투표해 주시면 감사하겠습니다.
(https://steemitwallet.com/~witnesses)

jswit 증인 노드 프로젝트를 시작합니다.

jsup 업보팅(upvoting) 서비스 소개

jsup 수혜자 지정 기능 추가

jSTEEM 프로젝트 - 텔레그램 챗봇으로 구현하는 스팀 블럭체인 탐색기

Comments

Popular posts from this blog

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

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

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