Closed anthonyattard closed 5 years ago
I done it complicated, but the simple solution is: Just every like update a json/pickle file with like amount and timestamp. From out side read this file and check every hour the timestamp is updated.
I have made something similar that sends me telegram messages in some cases I defined:
I'm using it because I have the script automated by cron and I need to see if the script is running correctly or not.
@iFede94 How did you integrate InstaPy with cron and Telegram? Have any resources you'd recommend to accomplish this?
@anthonyattard The idea is to have the InstaPy script automated by cron and the python telegram bot running with it. When InstaPy script starts, it creates an instance of the bot so it can send messages to me. The telegram bot idea came from the one linked in the readme but mine can only send messages to allowed chat IDs and can't receive any command. Basically if you look at quickstart.py, I start the bot at the top of the run function and I send a message when starting and finishing every task or when any exception occurs. If you want today I can upload my code on github and create a readme on how to use it.
@iFede94 Thanks that gives me some valuable pointers. A repo of your code would be great! Much appreciated.
You can find my repo here. You may need to change the path to get the general.log file because I'm using an old version of InstaPy and I don't know if they changed the path or not in the newer commits.
@iFede94 Thanks so much!
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
It would be possible to notify me through telegram when finished and with the exacts Follows/unfollows/likes performed during the session? thanks!
It would be possible to notify me through telegram when finished and with the exacts Follows/unfollows/likes performed during the session? thanks!
@iFede94
It would be possible to notify me through telegram when finished and with the exacts Follows/unfollows/likes performed during the session? thanks!
It was developed to work like this. My code is old so you should update it to reflect the changes made to InstaPy.
bot = InstaPy(username=insta_username,password=insta_password,headless_browser=False)
``C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\Scripts\python.exe C:/Users/rajrp/PycharmProjects/InstapyTrial/InstapyTrial.py InstaPy Version: 0.6.8 .. .. .. .. .. .. .. .. .. .. .. .. .. .. Workspace in use: "C:/Users/rajrp/AppData/Roaming/SPB_Data/InstaPy" Traceback (most recent call last): File "C:/Users/rajrp/PycharmProjects/InstapyTrial/InstapyTrial.py", line 22, in
bot = InstaPy(username=insta_username, File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\instapy\instapy.py", line 309, in init self.browser, err_msg = set_selenium_local_session( File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\instapy\browser.py", line 111, in set_selenium_local_session browser = webdriver.Firefox( File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in init RemoteWebDriver.init( File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
Traceback (most recent call last):
File "../quickstart.py", line 2, in
I'm looking for an automated method to confirming the bot is running as expected when automated with cron on a server. Something like another bot following some of the links that were interacted with and check if it actually did. A simpler method would be to have a notification sent out if the bot fails with an error.
Have has anyone come up with any methods to do this?