[개발] 스몬 카드 투자[5]

in #sct5 years ago (edited)

스몬 카드를 구입하면 ref 보상이 있습니다. 그러다보니 부계를 만들어서 카드를 사고 본계는 ref 보상을 받는 분이 많이 있습니다. 계좌가 여러 개 있으면 어떤 카드가 어느 계좌에 있는지 확인할 필요가 있습니다.

그래서 특정 카드가 어느 계좌에 있는지 확인하는 기능을 추가했습니다.
https://repl.it/@zonemultiwhs/smonall

사용법은 우선 관심있는 계좌 명을 아래와 같이 등록합니다.

INT_ACCOUNTS = ['tradingideas', 'smon-joa']

그 후 메뉴 8번을 사용하면 됩니다. 카드 이름에 스페이스바가 있다보니, 입력 방식이 조금 특이합니다. 우선 8번을 누른 후 카드 명을 입력하고 다시 엔터를 누르는 방식입니다.
실행 결과입니다.


특정 계좌가 보유하고 있는 카드 정보를 얻을 수 있는 API입니다.

https://steemmonsters.com/cards/collection/계정명

이 API가 돌려주는 json 형태의 자료 구조입니다.

구조에서 보듯이 카드 이름은 없고 card_detail_id 값이 들어있습니다. 따라서 id 값으로 이름을 찾은 후 찾는 카드인지 확인하는 방식으로 작업을 하면 됩니다.
또한 동일한 카드가 여러 장 있을 수 있으므로, 카드를 찾은 acc이름을 별도로 저장을 하고 있다가 중복 출력하는 것을 막아야 합니다.

            id = card['card_detail_id']
            if ( CARD_ID_NAME[str(id)][0].upper() == name.upper()) :
                if (acc not in found) :
                    print(format(acc, "16s"), name)
                    found.append(acc)
Sort:  

jcar토큰 9월 구독 보팅입니다. 행복한 추석 명절 보내세요. ^^

Thank you for your continued support towards JJM. For each 1000 JJM you are holding, you can get an additional 1% of upvote. 10,000JJM would give you a 11% daily voting from the 700K SP virus707 account.

Hi @tradingideas!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.398 which ranks you at #2480 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 116 contributions, your post is ranked at #38.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • The readers like your work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

카드 트레이닝이라는 블루오션을 찾으신 트아님 정말 대단합니다.

스몬에서 발행하는 DEC 가격은 스팀과 반대방향으로 움직여서 DEC이 헤지효과가 있네요.

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 64349.20
ETH 2673.53
USDT 1.00
SBD 2.83