Skip to content

Instantly share code, notes, and snippets.

@ShyftXero
Created July 2, 2021 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShyftXero/32ada3043e268271f92e1046b8992204 to your computer and use it in GitHub Desktop.
Save ShyftXero/32ada3043e268271f92e1046b8992204 to your computer and use it in GitHub Desktop.
import os
from time import sleep
# try:
# my_animals_file = open('other_animals.txt', 'r')
# for line in my_animals_file.readlines():
# print(line.strip() )
# my_animals_file.close()yword found in text
# except FileNotFoundError:
# print("the file was not found")
# exit()
# some_new_file = open("more_animals.txt", "w")
# some_new_file.write("yak, bison, \nwren")
# some_new_file.close()
# print('wait 3.5 seconds')
# sleep(3.5)
# print(os.listdir("tools"))
import requests
while True:
data = requests.get("https://msn.com")
# print(data.text)
if "hacker" in data.text:
print("hackers are in the news")
else:
print('hackers are not in the news')
print('waiting 5 min...')
sleep(3)
print('done')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment