파이썬 beem에서 특정 계정의 댓글 이력 조회

in python •  10 months ago 

파이썬 beem을 이용해서 특정 계정의 댓글 이력을 조회할 수 있습니다. Account 객체의 comment_history() 함수를 이용하며, 제네레이터(generator) 형식으로 가져옵니다. 예시를 보면 감을 잡을 수 있을 것입니다.

from beem import Steem
from beem.account import Account

s = Steem(node="https://api.steemit.com")
a = Account('joviansummer', blockchain_instance=s)

# 최근 5개의 댓글 가져오기
c_hist = a.comment_history(limit=5)

# 댓글 Comment 객체를 하나씩 가져와 출력
for reply in c_hist:
  # 댓글 작성자(author) -> 본문 작성자(parent author)
  print(reply.author, '->', reply.parent_author)
  # Comment 객체의 내용 출력
  print(reply.body)
  print(" ")

comment_history 함수에서 limit 값을 지정하지 않으면 API 노드에서 줄 수 있는 최대한 많은 댓글을 가져올 수 있습니다.


jsup 업보팅 서비스를 소개합니다.

jsup 업보팅 서비스를 활용한 일종의 오토보팅(auto-voting)

jsblurt 프로젝트 - 블러트 블럭체인 탐색기 (텔레그램 챗봇)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!