import time
import pyperclip
import requests

print(f"感谢使用！本程序需要iPhone、Mac打开接力；需要Windows运行对应脚本")
print(f"使用方法：https://manyouit.com/posts/153")
print(f"咨　　询：https://manyouit.com/q")
print(f"作　　者：挨踢君 from 漫游挨踢")

def custom_command(new_clipboard_content):
    url =f"http://192.168.2.93:8002/{new_clipboard_content}"
    print(f"Sending requests to URL: {url}")
    print(f"New clipboard content: {new_clipboard_content}")
    # 在这里替换为你想执行的自定义命令
    response = requests.get(url)

previous_content = pyperclip.paste()

while True:
    current_content = pyperclip.paste()
    
    if current_content != previous_content:
        custom_command(current_content)
        previous_content = current_content
    
    time.sleep(1)  # 每隔一秒检查一次剪贴板