Пример #1
0
def multifeed(puppet, puppet_active_key, puppet_posting_key):
    #lock.acquire()
    #upvote_history = []
    print("{} : Waiting for new posts by {}".format(puppet, my_subscriptions))
    steem = Steem(wif=puppet_posting_key)
    for comment in steem.stream_comments():

        if comment.author in my_subscriptions:
            #if len(comment.title) > 0:

            if comment.identifier in upvote_history:
                #upvote_history = []
                continue

            print("New post by @{} {}".format(comment.author,
                                              url_builder(comment)))

            try:
                print("Voting from {} account".format(puppet))
                comment.vote(100, puppet)
                print("====> Upvoted")
                upvote_history.append(comment.identifier)
            except BroadcastingError as e:
                print("Upvoting failed...")
                print("We have probably reached the upvote rate limit. {}".
                      format(e))
                print(str(e))
            except Exception as er:
                print("Error:{}".format(e))
            #lock.release()
            return print("Voted!")
Пример #2
0
def multifeed(puppet, puppet_active_key, puppet_posting_key):
    #lock.acquire()
    #upvote_history = []
    print("{} : Waiting for new posts by {}".format(puppet, my_subscriptions))
    steem = Steem(wif=puppet_posting_key)
    for comment in steem.stream_comments():

        if comment.author in my_subscriptions:
            #if len(comment.title) > 0:

                if comment.identifier in upvote_history:
                    #upvote_history = []
                    continue

                print("New post by @{} {}".format(comment.author, url_builder(comment)))

                try:
                    print("Voting from {} account".format(puppet))
                    comment.vote(100, puppet)
                    print("====> Upvoted")
                    upvote_history.append(comment.identifier)
                except BroadcastingError as e:
                    print("Upvoting failed...")
                    print("We have probably reached the upvote rate limit. {}".format(e))
                    print(str(e))
                except Exception as er:
                    print("Error:{}".format(e))
                #lock.release()
                return print("Voted!")
Пример #3
0
def vote(puppet, wif_key):
    steem = Steem(wif=wif_key)
    print("{} : Waiting for new posts by {}".format(puppet, my_subscriptions))
    for c in steem.stream_comments():
        if c.author in my_subscriptions:
            print(c.author)
            if c.identifier in upvote_history:
                continue
            print("New post by @{} {}".format(c.author, url_builder(c)))
            try:
                #print("Voting from {} account".format(puppet))
                #c.vote(100, puppet)
                #print("====> Upvoted")
                #upvote_history.append(c.identifier)
                print("Voting from {} account".format(puppet))
                curation_time = random.randint(840, 1020)
                print(c.identifier)
                t = threading.Thread(target=curation_delay_vote,
                                     args=(wif_key, puppet, c.identifier,
                                           curation_time))
                t.start()
                upvote_history.append(c.identifier)
            except Exception as e:
                print("Upvoting failed...")
                print("We have probably reached the upvote rate limit.")
                print(str(e))
Пример #4
0
def feed():
    print("Waiting for new posts by %s\n" % my_subscriptions)
    steem = Steem(wif=posting_key)
    for comment in steem.stream_comments():

        if comment.author in my_subscriptions:
            # Comments don't have titles. This is how we can know if we have a post or a comment.
            if len(comment.title) > 0:

                # check if we already upvoted this. Sometimes the feed will give duplicates.
                if comment.identifier in upvote_history:
                    continue

                print("New post by @%s %s" % (comment.author, url_builder(comment)))

                try:
                    comment.vote(100, account)
                    print("====> Upvoted")
                    upvote_history.append(comment.identifier)
                except BroadcastingError as e:
                    print("Upvoting failed...")
                    print("We have probably reached the upvote rate limit.")
                    print(str(e))
Пример #5
0
def feed():
    print("Waiting for new posts by %s\n" % my_subscriptions)
    steem = Steem(wif=posting_key)
    for comment in steem.stream_comments():

        if comment.author in my_subscriptions:
            # Comments don't have titles. This is how we can know if we have a post or a comment.
            if len(comment.title) > 0:

                # check if we already upvoted this. Sometimes the feed will give duplicates.
                if comment.identifier in upvote_history:
                    continue

                print("New post by @%s %s" %
                      (comment.author, url_builder(comment)))

                try:
                    comment.vote(100, account)
                    print("====> Upvoted")
                    upvote_history.append(comment.identifier)
                except BroadcastingError as e:
                    print("Upvoting failed...")
                    print("We have probably reached the upvote rate limit.")
                    print(str(e))
Пример #6
0
import sys
import datetime
import os
import subprocess
from piston.steem import Steem
from random import randint

from piston.steem import Steem

steemPostingKey = os.environ.get('steemPostingKey')
steemAccountName = os.environ.get('steemAccountName')

steem = Steem(wif=steemPostingKey)
tagsOrAuthors = [
    "smartcash", "crypt0", "heiditravels", "jerrybanfield", "whiteblood",
    "scooter77", "ellemarieisme", "shayne", "maneco64"
]
voteWeight = 50

for p in steem.stream_comments():
    for tag in tagsOrAuthors:
        try:
            # make p["tags"] into p["author"] if you are voting by author and not by tag
            if tag in p["author"] and p.is_main_post():
                vote = p.upvote(weight=+voteWeight, voter="your username here")
                print("Upvoted post by @" +
                      vote["operations"][0][1]["author"] + " using account @" +
                      vote["operations"][0][1]["voter"] + "!")
        except:
            print("Failed to vote on post.")
Пример #7
0
import time
from piston.steem import Steem
import os
import json

steem = Steem(wif=os.environ["WIF"])
print ("login OK")
authors = json.loads(os.environ["AUTHORS"])
print ("checking authors OK")
for c in steem.stream_comments(mode="head"):
     if c["author"] in authors and c.identifier == c.openingPostIdentifier:
        try:
            time.sleep(1000)
            print(c.upvote())
        except:
            print ("something went wrong, your vote was NOT casted")

Пример #8
0
from piston.steem import Steem
import os
import json
import sendgrid
steem = Steem()
sg = sendgrid.SendGridClient(
    os.environ['SENDGRID_USERNAME'],
    os.environ['SENDGRID_PASSWORD']
)
message = sendgrid.Mail()
addresses = {"xeroc": "*****@*****.**"}
# addresses = os.environ["ADDRESSES"]
for c in steem.stream_comments():
    for user in addresses.keys():
        if "@%s" % user in c["body"]:
            message.add_to(addresses[user])
            message.set_subject('Notification on Steem')
            message.set_text(
                "You have been messaged by %s " % (c["author"]) +
                "in the post @%s/%s" % (c["author"], c["permlink"]) +
                "\n\n" +
                "You can read the post on Steemit.com:\n" +
                "http://steemit.com/%s/%s#@%s/%s"
                % (c["category"],
                    c["openingPostIdentifier"],
                    c["author"], c["permlink"])
            )
            message.set_from('notify@steem')
            status, msg = sg.send(message)
            print("\nMessage sent!\n")
Пример #9
0
from piston.steem import Steem
import os
import json
steem = Steem(wif=os.environ["WIF"])
authors = json.loads(os.environ["AUTHORS"])
for c in steem.stream_comments(mode="head"):
    if c["author"] in authors:
        print(c.upvote())