Menu

Tracking SMM Order Status in Bulk: A Cron Job That Emails You Only When Something Breaks
📰

Tracking SMM Order Status in Bulk: A Cron Job That Emails You Only When Something Breaks

DEV Community: api·SEO - NT Tech Innovation·1 day ago
#Nk7q7MGo
#devtoapi#devto#dev#orders#status
Reading 0:00
15s threshold

Checking order status by hand is fine for five orders. At fifty a day it eats your morning. Most /api/v2 panels let you ask about up to 100 orders in a single status call, so a small cron job can do the checking and only bother you when an order is stuck.

What we want

Check every open order once an hour.

Stay quiet when everything is fine.

Send one short alert listing orders that are stuck, partial or canceled.

The multi-status call

Instead of order=123 , send orders=123,124,125 . The panel returns a dict keyed by order id:

{ "123" : { "status" : "Completed" , "remains" : "0" }, "124" : { "status" : "In progress" , "remains" : "340" }, "125" : { "status" : "Partial" , "remains" : "120" }}

Enter fullscreen mode

Exit fullscreen mode

The script

import os , sqlite3 , time , requests

API_URL , API_KEY = os . environ [ " PANEL_URL " ], os . environ [ " PANEL_KEY " ] STUCK_AFTER = 6 * 3600 # seconds db = sqlite3 . connect ( " orders.db " ) open_rows = db .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.