[cron:6dd85dd2-28ce-411f-b2de-8106e314da47 Deal Post - X + Pinterest (every 30 min)] SCHEDULED TASK: Post 1 deal to X and Pinterest using Maya VM twikit/py3-pinterest.

## CRITICAL: Use Maya VM, NOT Fred social-poster
- X: twikit v2.3.3 on Maya VM (`ssh maya@maya`)
- Script: `/home/maya/workspace/scripts/x_twikit_post2.py`
- Cookies: `/home/maya/workspace/x_cookies.json`

## Workflow
1. Fetch deals: `curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" | python3 -c "import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get('deals',[]); [print(f\"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%\") for x in deals[:15]]"`
2. Check hash: `python3 scripts/posted_db.py check <deal_id> x`
3. If POSTED:YES — SKIP, pick another
4. Pick unposted deal (50%+ off, popular brand, limited time, freebies, under $10)
5. Download share image: `wget -q "https://www.gottahavecoups.com/api/v1/share/image/<deal_id>" -O /tmp/deal_img.jpg`
6. **BUILD TWEET:** Hook + value + 5-8 hashtags + link LAST. KEEP UNDER 280 CHARS.
7. **MANDATORY VALIDATION:** `python3 scripts/validate_tweet.py '<tweet_text>'` — If INVALID, STOP and pick different deal.
8. **POST TO X (Maya VM twikit):**
   ```bash
   ssh maya@maya "cat > /tmp/tweet.txt << 'TWEET'
   <tweet text here>
   TWEET"
   scp /tmp/deal_img.jpg maya@maya:/tmp/deal_img.jpg
   ssh maya@maya "python3 /home/maya/workspace/scripts/x_twikit_post2.py <deal_id> --file /tmp/tweet.txt"
   ```
9. **POST TO PINTEREST (Maya VM py3-pinterest):**
   ```bash
   ssh maya@maya "python3 /home/maya/workspace/scripts/pin_post_v2.py <deal_id> '<title>' '<description>' 1134485031073239531"
   ```
10. Record posts: `python3 scripts/posted_db.py record <deal_id> x <tweet_id> <url>`
11. Log in memory/YYYY-MM-DD.md

## If X cookies expired
Run: `ssh maya@maya "DISPLAY=:0 python3 /home/maya/workspace/scripts/extract_x_cookies.py"`

## Tweet format (STRICT)
- Hook (emoji + deal highlight)
- Product name + price (with $, e.g., "$12.99")
- 5-8 hashtags
- Link LAST: gottahavecoups.com/deal/<id>
- KEEP UNDER 280 CHARS

## NEVER post if validation fails:
- Shell artifacts (/bin/bash, python3 -c)
- Broken prices (.20 instead of $10.20)
- Broken emojis (�)
- > 280 chars
Current time: Thursday, February 12th, 2026 — 6:27 PM (UTC)

Return your summary as plain text; it will be delivered automatically. If the task explicitly calls for messaging a specific external recipient, note who/where it should go instead of sending it yourself.


The user wants me to execute a scheduled task to post a deal to X and Pinterest. Let me follow the workflow:

1. First, fetch deals from the API
2. Check which ones are already posted
3. Pick an unposted deal
4. Download the share image
5. Build a tweet and validate it
6. Post to X using Maya VM
7. Post to Pinterest using Maya VM
8. Record the posts

Let me start by fetching the deals.

I'll execute this scheduled deal post. Let me start by fetching deals and checking the database.

exec

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" | python3 -c "import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get('deals',[]); [print(f'{x[\"id\"]}|{x.get(\"title\",\"\")[:60]}|${x.get(\"price\",\"\")}|{x.get(\"discount_percentage\",0)}%') for x in deals[:15]]"


/bin/bash: line 1: import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get('deals',[]); [print(f'{x["id"]}|{x.get("title","")[:60]}|${x.get(\"price\",\"\")}|{x.get("discount_percentage",0)}%') for x in deals[:15]]: bad substitution

Command exited with code 1


The command failed due to quote escaping issues. Let me try a different approach - write a temporary Python script to fetch and format the deals.

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" > /tmp/deals.json && python3 << 'PYEOF'
import json
with open('/tmp/deals.json') as f:
    d = json.load(f)
deals = d if isinstance(d, list) else d.get('deals', [])
for x in deals[:15]:
    print(f"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%")
PYEOF


Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/lib/python3.12/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Command exited with code 1


The API might be down or returning empty. Let me check what the curl actually returns.

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" -w "\nHTTP_CODE: %{http_code}\n"


HTTP_CODE: 307


It's a redirect (307). Let me follow the redirect with -L.

curl -sL "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" > /tmp/deals.json && python3 << 'PYEOF'
import json
with open('/tmp/deals.json') as f:
    d = json.load(f)
deals = d if isinstance(d, list) else d.get('deals', [])
for x in deals[:15]:
    print(f"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%")
PYEOF


33862|D'Lish Deviled Eggs:A Collect...cipes from Creative to Class|$1.99|75%
33864|Chloraseptic Max Strength Sore Throat Lozenges,choice of Che|$3.52|None%
33866|Sertapedic Bed Pillow 2-Packs Just $10 on Walmart.com (Reg.$|$10.0|None%
33865|FlexWave 55LB Olympic Bumper Plates Pair (110lb total),2-Inc|$69.0|None%
33863|LISEN Adjustable 360-Degree Tablet Stand Holder (up to 12.9"|$10.0|None%
33861|78.03 | 25-Piece Schleich Farm World Farm Animal Playset at |$78.03|22%
33860|Men’s Winter GENUINE LEATHER Slippers,Memory Foam Suede Shoe|$9.99|None%
33858|Subspecies 4:Bloodstorm|$8.78|49%
33867|Squishmallows Toddler Slippers Only $5 on Walmart.com (Regul|$5.0|None%
33856|Amazon Essentials Boys' Uniform Short-Sleeve Pique Polo Shir|$None|None%
33859|Pampers Diapers - Baby Dry - Size 5,164 Count,Absorbent Disp|$19.0|None%
33854|Puppia Soft Dog Harness No Cho...Release Buckle,Brown,X-Larg|$10.49|53%
33851|GIGABYTE X870 EAGLE WIFI7 Motherboard $170 + Free Shipping|$170.0|None%
33847|YMMV Clearance - TCL 85" Class QM7K Series QD-Mini LED QLED |$900.0|None%
33845|Dyson WashG1 Wet Hard Floor Cleaner (Matte Black/Ultra Blue)|$399.99|None%


Good, I have the deals. Let me now check which ones are already posted to X. I'll check a few deals - let me prioritize ones with good discounts.

Looking at the deals:
- 33862: $1.99, 75% off (book)
- 33854: $10.49, 53% off (dog harness)
- 33858: $8.78, 49% off (Subspecies 4: Bloodstorm - the image shown!)
- 33851: $170 (motherboard)
- 33847: $900 (TCL TV)
- 33845: $399.99 (Dyson)

Let me check these against the posted_db.

Now let me check which deals haven't been posted yet:

python3 scripts/posted_db.py check 33862 x && python3 scripts/posted_db.py check 33854 x && python3 scripts/posted_db.py check 33858 x && python3 scripts/posted_db.py check 33864 x && python3 scripts/posted_db.py check 33867 x


POSTED:NO
POSTED:YES
POSTED:YES
POSTED:NO
POSTED:NO


So:
- 33862: NOT posted, 75% off, $1.99 - D'Lish Deviled Eggs cookbook
- 33854: POSTED (skip)
- 33858: POSTED (skip) - this is the Subspecies 4 deal with the image
- 33864: NOT posted - Chloraseptic lozenges $3.52
- 33867: NOT posted - Squishmallows toddler slippers $5

Let me get more details on 33862 (the cookbook at 75% off seems like a good deal):

Good candidates: 33862 (75% off cookbook $1.99), 33864 (Chloraseptic $3.52), 33867 (Squishmallows slippers $5). Let me get full details:

python3 << 'PYEOF'
import json
with open('/tmp/deals.json') as f:
    d = json.load(f)
deals = d if isinstance(d, list) else d.get('deals', [])
for x in deals:
    if x['id'] in [33862, 33864, 33867]:
        print(f"ID: {x['id']}")
        print(f"Title: {x.get('title','')}")
        print(f"Price: ${x.get('price','')}")
        print(f"Original: ${x.get('original_price','')}")
        print(f"Discount: {x.get('discount_percentage','N/A')}%")
        print(f"Brand: {x.get('brand','N/A')}")
        print(f"Source: {x.get('source','N/A')}")
        print(f"URL: {x.get('url','')}")
        print("---")
PYEOF


ID: 33862
Title: D'Lish Deviled Eggs:A Collect...cipes from Creative to Classic
Price: $1.99
Original: $7.99
Discount: 75%
Brand: None
Source: Amazon
URL:
---
ID: 33864
Title: Chloraseptic Max Strength Sore Throat Lozenges,choice of Cherry,Wild Berries or Sugar Free,15 Count,1 Pack $3.52 S&S
Price: $3.52
Original: $None
Discount: None%
Brand: None
Source: Amazon
URL:
---
ID: 33867
Title: Squishmallows Toddler Slippers Only $5 on Walmart.com (Regularly $16
Price: $5.0
Original: $None
Discount: None%
Brand: None
Source: Walmart
URL:
---


33862 looks like a great deal - 75% off a cookbook for only $1.99 (was $7.99). Let me go with that one.

Now I need to:
1. Download the share image
2. Build a tweet (under 280 chars, hook + value + 5-8 hashtags + link last)
3. Validate the tweet
4. Post to X via Maya VM
5. Post to Pinterest via Maya VM
6. Record the post

Let me download the image first.

I'll go with **deal 33862** - the cookbook at 75% off for $1.99. Great value and high discount percentage. Let me download the share image:

wget -q "https://www.gottahavecoups.com/api/v1/share/image/33862" -O /tmp/deal_img.jpg && ls -la /tmp/deal_img.jpg


-rw-rw-r-- 1 crogers2287 crogers2287 90654 Feb 12 18:27 /tmp/deal_img.jpg


Image downloaded. Now let me build a tweet. I need:
- Hook (emoji + deal highlight)
- Product name + price
- 5-8 hashtags
- Link LAST
- Under 280 chars

Deal: D'Lish Deviled Eggs cookbook, $1.99 (was $7.99), 75% off

Draft tweet:
🔥 75% OFF! D'Lish Deviled Eggs Cookbook — just $1.99 (was $7.99)! From classic to creative recipes 🥚📚

#DeviledEggs #Cookbook #RecipeBook #AmazonDeals #Foodie #Cooking #DealAlert #GottaHaveCoups

gottahavecoups.com/deal/33862

Let me count: that's about 210 chars. Let me verify exact length.

Now building the tweet:

cat > /tmp/tweet.txt << 'EOF'
🔥 75% OFF! D'Lish Deviled Eggs Cookbook — just $1.99 (was $7.99)! From classic to creative recipes 🥚📚

#DeviledEggs #Cookbook #RecipeBook #AmazonDeals #Foodie #Cooking #DealAlert #GottaHaveCoups

gottahavecoups.com/deal/33862
EOF
cat /tmp/tweet.txt && wc -c /tmp/tweet.txt


🔥 75% OFF! D'Lish Deviled Eggs Cookbook — just $1.99 (was $7.99)! From classic to creative recipes 🥚📚

#DeviledEggs #Cookbook #RecipeBook #AmazonDeals #Foodie #Cooking #DealAlert #GottaHaveCoups

gottahavecoups.com/deal/33862
237 /tmp/tweet.txt


237 chars including newlines. That's under 280, good. Now I need to validate it using the validation script.

237 chars — under 280. Now validating:

python3 scripts/validate_tweet.py "$(cat /tmp/tweet.txt)"


VALID


Tweet is valid! Now I need to post to X using the Maya VM. Let me:
1. Copy the tweet text and image to Maya VM
2. Run the x_twikit_post2.py script

✅ Validated. Now posting to X via Maya VM:

scp /tmp/deal_img.jpg maya@maya:/tmp/deal_img.jpg && ssh maya@maya "cat > /tmp/tweet.txt << 'TWEET'
🔥 75% OFF! D'Lish Deviled Eggs Cookbook — just $1.99 (was $7.99)! From classic to creative recipes 🥚📚

#DeviledEggs #Cookbook #RecipeBook #AmazonDeals #Foodie #Cooking #DealAlert #GottaHaveCoups

gottahavecoups.com/deal/33862
TWEET"


Warning: Permanently added 'maya' (ED25519) to the list of known hosts.
Warning: Permanently added 'maya' (ED25519) to the list of known hosts.


Files copied to Maya. Now let me run the post script.

ssh maya@maya "python3 /home/maya/workspace/scripts/x_twikit_post2.py 33862 --file /tmp/tweet.txt"


Warning: Permanently added 'maya' (ED25519) to the list of known hosts.
Cookies loaded
Authenticated as: @GottaHaveCoups
Image downloaded: /home/maya/workspace/downloads/deal-33862.jpg (90654 bytes)
Uploading image...
Image uploaded, media_id: 2022014878056132608
Posting tweet...
SUCCESS! Tweet ID: 2022014881407676643
URL: https://x.com/GottaHaveCoups/status/2022014881407676643


X post successful! Tweet ID: 2022014881407676643. Now I need to post to Pinterest using the pin_post_v2.py script. I need to construct a title and description for the pin.

Title: D'Lish Deviled Eggs Cookbook - $1.99 (75% off)
Description: Grab this deviled eggs recipe book for just $1.99 (was $7.99)! 75% off on Amazon. From classic to creative recipes.

Board ID: 1134485031073239531

🎉 X posted! Now posting to Pinterest:

ssh maya@maya "python3 /home/maya/workspace/scripts/pin_post_v2.py 33862 'D'\''Lish Deviled Eggs Cookbook - \$1.99 (75% off)' 'Grab this deviled eggs recipe book for just \$1.99 (was \$7.99)! 75% off on Amazon. From classic to creative recipes.' 1134485031073239531"


Warning: Permanently added 'maya' (ED25519) to the list of known hosts.
Loaded 8 cookies
Boards: 200
Found 7 boards (raw type: dict)
Raw keys: ['all_boards', 'boards_shortlist', 'create_suggestions']
  🔥 Today’s Best Deals (id: 1134485031073239531)
  Limited Time Promo Codes (id: 1134485031073239590)
  Gifts Under $50 (id: 1134485031073239588)
  Amazon Deals & Coupons (id: 1134485031073239559)
  Home & Kitchen Savings (id: 1134485031073239570)
Image upload: 200
Image URL: https://i.pinimg.com/previews/RuWOkPJr.jpeg
Pin create: 200
SUCCESS! Pin ID: 1134484962398613138


Pinterest post successful! Pin ID: 1134484962398613138. Now I need to record the posts in the database and log to memory.

✅ Pinterest posted! Recording to database:

python3 scripts/posted_db.py record 33862 x 2022014881407676643 https://x.com/GottaHaveCoups/status/2022014881407676643


Recorded 33862 for x


Now I need to log this in memory/YYYY-MM-DD.md. Let me check what today's date is and write the log entry.

Now logging to memory file:

write

## Deal Post — Thursday, February 12, 2026

**Posted:** D'Lish Deviled Eggs Cookbook (Deal #33862)
- Price: $1.99 (was $7.99, 75% off)
- Platform: Amazon
- Category: Books/Cooking

**X Post:**
- Tweet ID: 2022014881407676643
- URL: https://x.com/GottaHaveCoups/status/2022014881407676643
- Characters: 237

**Pinterest Post:**
- Pin ID: 1134484962398613138
- Board: Today's Best Deals

**Validation:** PASSED ✅
**Status:** Both posts successful


Successfully wrote 445 bytes to memory/2026-02-12.md


Done! Let me provide a summary to the user.

---

## ✅ Deal Post Complete

**Deal:** D'Lish Deviled Eggs Cookbook (#33862)
- **Price:** $1.99 (was $7.99) — **75% off**
- **Source:** Amazon

**X (Twitter):** Posted successfully
- Tweet ID: `2022014881407676643`
- URL: https://x.com/GottaHaveCoups/status/2022014881407676643

**Pinterest:** Posted successfully
- Pin ID: `1134484962398613138`
- Board: "Today's Best Deals"

**Database:** Recorded deal as posted to X
**Memory Log:** Updated `memory/2026-02-12.md`