jsup 2.1 - investor's relief (experiment on separation of investment and SNS)

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-2-1-investor-s-relief-experiment-on-separation-of-investment-and-sns Hello, this is @joviansummer(witness: @jswit). I'm starting a new experiment regarding my @jsup vote service. The purpose of this experiment is to separate STEEM investment and social interaction(posting/commenting). For many people, writing a post daily(literally 365 posts per year) is not easy. It's not fun, and mandatory daily post only written for self-voting delegation service tends to result in useless low-quality content. I hope this new function of @jsup will reduce those posts, and also make it a bit more easy to invest in STEEM without worrying about daily posting. I think pressure of daily posting significantly undermines Steem as SNS. It's not fun. This is how it works: From 11:45 PM to 11:50 PM every night(reference time zone is GMT+9), @jsup checks if eligible delegators wrote something and received daily v...

파이썬에서 스팀잇 웹접속을 통한 최근 포스팅 주소(url) 확인

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/url


jsup/templar-kr 업보팅 서비스 보완을 위한 작업과 관련하여 필요한 사항이라 메모해 둡니다. 보완 방안에 대한 내용은 아래의 링크입니다.

jsup/templar-kr 업보팅 서비스 보완 방안 https://steemit.com/hive-141029/@joviansummer/7j3zha-jsup-templar-kr

최근 포스팅 목록을 api 서버를 통하지 않고 steemit.com 웹서버에 접속해서 확인하는 방법입니다. 파이썬의 requests 모듈을 활용합니다.

스팀잇 사용자의 포스팅 목록의 접속 주소는, 예를 들어 joviansummer의 포스팅 목록은 https://steemit.com/@joviansummer/posts에 있습니다. requests를 이용해서 웹 접속에 대한 응답을 받아올 수 있습니다.

import requests

steem_id = 'joviansummer'
post_list_url = 'https://steemit.com/@' + steem_id + '/posts'
# HTTP GET 요청으로 포스트 목록 받아오기 
response = requests.get(post_list_url)

위와 같이 하면 response.text에 응답으로 온 html 데이터가 문자열(string) 형식으로 저장됩니다. 우선 html 태그(tag)의 시작 지점인 '<' 기준으로 여러 줄로 분할합니다.

# 태그 시작점을 기준으로 줄바꿈(\n)을 추가하여 multiline_response에 할당
multiline_response = response.text.replace('<','\n<')

각 포스트의 주소는 아래와 같은 형태의 항목에서 확인 가능합니다.

\<a class="timestamp__link" href="/hive-196917/@joviansummer/jsup-sp-vote-weight" data-reactid="735">

따라서, 각 행별로 'timestamp__link' 문자열이 있는지 확인하여 이 부분만 따로 모아서 리스트(list)로 만들 수 있습니다.

post_links = []
for line in multiline_response.split('\n'):
  if line.find('timestamp__link') >=0:
    href_data = line.split('"')[3]
    post_links.append(href_data)

Comments

Popular posts from this blog

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

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

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