Do you lost control of your feed?
A few days ago i started a discussion with @crypto.piotr, it all began when the poor guy was victim of one of my Batman moments about transfer memo spam Read it here in a post of my friend @por500bolos.
He claims he made the mistake of following too many people in his beginnings and lost control of his feed and does not want to used centralized solutions to engage with people...
I know there is that nice UNFOLLOW button, but yeah... He is following 3000+ accounts. Even if it is his own fault and i consider the responsible thing would be to recover control of his feed by checking those followed authors and selectively unfollow them, or unfollow everyone using a program and start once again (I can help you with python code for that)
Well I decided to try to give him a hand
So I cooked this nice python script that gets a list of people you are following, and checks when was the last time they posted or voted a post.
The idea is that most people who haven't been active in the platform for 30 or more days are most likely unfollow candidates.
from datetime import datetime
from steem import Steem
from steem.account import Account
from steem.account import Account
stm = Steem(keys = "---posting_key---") # posting
account_to_check ='crypto.piotr'
I think there might be a way to paginate using the start_follower
to get trough the 3000+ but i need motivation to figure it out.
i_follow = stm.steemd.get_following(account_to_check ,start_follower='', follow_type='blog' ,limit=1000)
u_r_following={}
end_date = datetime.utcnow()
i = 0
for data in i_follow:
user = Account(data['following'])
last_vote = datetime.strptime(str(user['last_vote_time']), '%Y-%m-%dT%H:%M:%S')
delta_vote = abs((end_date - last_vote).days)
last_post = datetime.strptime(str(user['last_root_post']), '%Y-%m-%dT%H:%M:%S')
delta_post = abs((end_date - last_post).days)
u_r_following.update({data['following']:user})
if delta_vote > 30 and 30 < delta_post > 10000: # looks dead to me
print('**{}**, posted {} days ago, last voted: {} days ago (LOOKS Dead)'.format(data['follower'], delta_post,delta_vote))
elif delta_post > 10000:
print('**{}**, never posted, maybe is a vote BOT or a Curator'.format(data['follower']))
It has the limitations of the API nodes of steemit, so it will only check the first 1000 blogs, don't run it 2 or 3 times in a row because the nodes will block your requests, it is heavy in resources.
It will get you at the end a nice json style dict u_r_following
of all of the people you follow and their latest details, you can figure out how to save it, something on the lines of:
import json
data_file = 'following.json'
data = json.load(open(data_file ))
json.dump(u_r_following, open(data_file ,'w'))
Yeah that should save it in the disk
Finally if you want to start from scratch my friend
Unfollow everyone and start afresh
for user in u_r_following:
stm.commit.unfollow(user , what=['blog'], account=account_to_check)
You got a 64.92% upvote from @ocdb courtesy of @nnnarvaez! :)
@ocdb is a non-profit bidbot for whitelisted Steemians, current max bid is 60 SBD and the equivalent amount in STEEM.
Check our website https://thegoodwhales.io/ for the whitelist, queue and delegation info. Join our Discord channel for more information.
If you like what @ocd does, consider voting for ocd-witness through SteemConnect or on the Steemit Witnesses page. :)