Created
October 12, 2023 19:04
-
-
Save Ethic41/757d9b5cb2366d7752ff4965671c818a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env python3 | |
| #Author: Dahir Muhammad Dahir | |
| #Date: 05th-02-2022 | |
| from time import sleep | |
| import requests | |
| def main(): | |
| keep_alive() | |
| def keep_alive(): | |
| url = input("enter url to keep alive:\n") | |
| time_interval = input("[Optional] enter time interval in seconds, default 5mins (300 seconds):\n") | |
| time_interval = time_interval if time_interval else 300 | |
| print(f"keeping {url} alive at {time_interval} seconds interval...") | |
| while True: | |
| with requests.Session() as s: | |
| s.get(url) | |
| sleep(int(time_interval)) | |
| if __name__ == "__main__": | |
| main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment