0

I have a Python script that does an HTTP request:

import requests

# https://discord.com/api/v9/channels/1052679335221411901/messages

payload = {'content': "Smurf Supply Grand opening!\n\nFresh League of Legends NA accounts\n40-50k BE\nEmail "
                      "Unverified\n\nPayment methods: Paypal/Crypto\n\nPrice : 0.85 USD\n\nBulk discounts DM "
                      "ME\n\nGiveaway 10X accounts in bio\n\nhttps://shoppy.gg/@Hijoka "
           }

header = {'authorization': 'MTAzNTMwNDMwNTIxMDcwMzk0Mg.G7ZkQI.SJZUo_4o-_z6fmw0TQUTlWHrTXvhAMSRlWOMN4'}

r = requests.post("https://discord.com/api/v9/channels/1052679335221411901/messages", json=payload, headers=header)

I would like this to script to repeat itself every 30 minutes. How would I go about doing this?

Woody1193
  • 7,252
  • 5
  • 40
  • 90
Hijoka
  • 1
  • 1
    Create a cronjob: `*/30 * * * * python3 my_script.py >/dev/null 2>&1` https://crontab-generator.org/ and https://en.wikipedia.org/wiki/Cron – Daniel F Dec 15 '22 at 23:41
  • `while True: r = requests.post("..."); time.sleep(30 * 60)` – CryptoFool Dec 15 '22 at 23:44
  • https://stackoverflow.com/questions/48810440/how-to-get-my-script-to-repeat-every-30-mins-with-python-on-windows – PM 77-1 Dec 15 '22 at 23:45
  • @CryptoFool i did what you told me, im getting error multiple statements on one line – Hijoka Dec 15 '22 at 23:53

0 Answers0