Hello, I want to use session.grab_followers once a week, and in the other days load the .json in a session.follow_by_list in partition (the Json has 100k), my question is what can i do for load the last json for the session.grab_followers.
Thks!!!!
@aleeepp
grab_followers feature is grabbing a live data from the servers.
But if you want to load an existing old copy of some relationship data in its local folder into a variable, you have to do sth else.
To get the last file from there, you can write a few lines of date matching cos the data files are keeping the record time in them.
load_followers_data.Do this to get it work:
#inside your quickstart script
## near imports
from instapy.relationship_tools import load_followers_data
##ready to go state
followers_data, selected_filename = load_followers_data(username="dominic", compare_by="latest", compare_track=None, logger=session.logger, logfolder=session.logfolder)
Now follower_data variable holds the data stored in the selected_filename JSON.
Plain and simple 馃榿
You can also use the value- "earliest" in compare_by parameter to make it load the very earliest data file in there OR all the available values compare_by (_and compare_track_) can get (_see README for more_).
Good thing is that function is super useful but cos of it was intended for internal usage I did not make it more accessible.
BTW I have not tested it, please, let me know if something does not work as intended. 馃檶
Cheers 馃榿
@aleeepp,
You can try to use my little modification of load_followers_data in #2515 to make the command more versatile. So that it can be used to load any type of relationship data, instead of just followers.
And again, thanks to @uluQulu for the helpful assistance! 馃
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. > If this problem still occurs, please open a new issue
Most helpful comment
@aleeepp,
You can try to use my little modification of
load_followers_datain #2515 to make the command more versatile. So that it can be used to load any type of relationship data, instead of just followers.And again, thanks to @uluQulu for the helpful assistance! 馃