def update(): # retrieve var from newest_porcys_url_imported first_porcys_url = newest_porcys_url_imported() # retrieve var from newest_pitchfork_url_imported first_pitchfork_url = newest_pitchfork_url_imported() # fetch newest review url with get_porcys_review_url get_latest_porcys_url_ = get_porcys_review_url() get_latest_porcys_url = get_latest_porcys_url_[0] # fetch newest review url with get_pitchfork_review_url get_latest_pitchfork_url_ = get_pitchfork_review_url() get_latest_pitchfork_url = get_latest_pitchfork_url_[0] a = first_porcys_url + " " + get_latest_porcys_url b = first_pitchfork_url + " " + get_latest_pitchfork_url get_datetime = datetime.now() hour = str(get_datetime.hour) minutes = str(get_datetime.minute) f = open("log.txt", "a") f.write(hour + ":" + minutes + " " + a + " " + b + "\n") f.close() if first_porcys_url != get_latest_porcys_url or first_pitchfork_url != get_latest_pitchfork_url: print("new reviews") return True else: pass return False
def newest_porcys_url_imported(): porcys_url_ = get_porcys_review_url() porcys_url = porcys_url_[0] return porcys_url