This uses weatherapi.com (FREE). Get an account, then copy your API key and run the code below. NOTE: I modified the file. It will not work using the original file. Instructions: BEFORE RUNNING, run "pip3 install scratchattach requests" on the command prompt. Then, just copy and paste everything below into a .py file (to run, use python3 path/to/python/file.py): import scratchattach, requests, getpass, time print("Press Ctrl+C to exit at any time.") sess=scratchattach.login(input("Enter your username: "), getpass.getpass("Password (Hides itself):")) conn=sess.connect_cloud(input("What's the project ID?\n")) api_key=input("Enter your weatherapi.com api key: ") encoder=scratchattach.Encoding() def main(rors): count=1 try: print(f"Python server has {rors}!") while True: if conn.get_var("GET")!="0": message=encoder.decode(conn.get_var("GET")) if message: output=requests.get(f"https://api.weatherapi.com/v1/current.json?key={api_key}&q={message}&aqi=no") out=output.json()["current"]["condition"]["text"] while out!="": if len(out)>128: conn.set_var("GET", encoder.encode(out[0:123]+"._C.-")) out=out[123:len(out)] else: conn.set_var("GET", encoder.encode(out)) out="" time.sleep(3) else: conn.set_var("GET", encoder.encode("error")) time.sleep(3) conn.set_var("GET", "0") conn.disconnect() time.sleep(5) conn.reconnect() time.sleep(2) count+=1 if count>=10: conn.disconnect() time.sleep(5) conn.reconnect() count=1 except KeyboardInterrupt: if input("Press enter to stop, press r and enter to resume.") in ["r", "R", "resume"]: main("resumed") else: conn.disconnect() main(rors="started")
This doesn't really work, but maybe someday someone will fix it!