Exemplo n.º 1
0
class User:
    def __init__(self, login="******", password="******"):
        self.steem_instance_ = Steem(node="wss://ws.testnet3.golos.io",
                                     rpcuser=login,
                                     rpcpassword=password)
        self.user_ = account.Account(account_name=login,
                                     steem_instance=self.steem_instance_)
        print(self.user_.get('name'))

    def get_posts(self, limit=10, sort="active", category=None, start=None):
        # list of dicts
        return self.steem_instance_.get_posts(limit=limit,
                                              sort=sort,
                                              category=category,
                                              start=start)

    # cause of Golos API doesnt work
    def get_user_posts(self):
        return self.steem_instance_.get_blog(self.user_.get('name'))

    def post(self, title, body, category=None, tags=[]):

        self.steem_instance_.post(title,
                                  body,
                                  author=self.user_.get('name'),
                                  category=category,
                                  tags=tags)
Exemplo n.º 2
0
class Man:
    def __init__(
            self,
            login="******",
            password="******"):
        self.steem_instance_ = Steem(node="wss://ws.testnet3.golos.io",
                                     rpcuser=login,
                                     rpcpassword=password)
        self.user_ = account.Account(account_name=login,
                                     steem_instance=self.steem_instance_)

    def get_posts(self, limit=10, sort="active", category=None, start=None):
        # list of dicts
        return self.steem_instance_.get_posts(limit=limit,
                                              sort=sort,
                                              category=category,
                                              start=start)

    def get_user_posts(self, ):
        pass