5
netikras
28d

The seller told me they'll have the product available in EU on Nov 5th.

Me: refreshing the ali page every 30 minutes since I got up

Should I perhaps write a script for it....?

Comments
  • 3
    Well, if you consider
  • 1
    @Lor-inc
  • 3
    A script, then yes
  • 3
    @Lor-inc well, it's more like
    ```
    while :; do avail=$(curl -siLk "https://aliexpress.com/item/..." | tr -d '\n' | sed -e 's/^.*data://g' -e 's/,\s*csrfToken:.*//g' | jq '.skuModule.skuPriceList[] | select(.skuAttr | test(".*203287806.*Pro.*")) | .skuVal.availQuantity') && { [ "${avail}" != 0 ] && notify-send "Got ${avail} items in EU"; } ; date; echo "Available: ${avail}" ; sleep 60; echo; done
    ```
  • 2
  • 3
    @netikras I won't even try to understand that, but sure.
  • 1
    My concept was that you can grep for the purchase button and rely on the fact that grep returns 1 if no rows match.
  • 0
    @Lor-inc yeah, I got that. Problem is that it's not the "purchase" button I have to grep for - I have to cross-map several JSON objects by common values in order to figure out whether the SKU I want is available :) And that JSON is hardwired into the HTML. So there's some sanitizing and cross-referencing to be done ;)
  • 0
    @netikras Can you not set up a page that displays this info in text and then just copy the URL? I get that this also works, just out of curiosity.
  • 0
    @Lor-inc Not sure I got what you mean, but that still means parsing the outer HTML. Also, I will have to keep glancing at that page + I still need to write it :/

    Unless you had smth else in mind
  • 2
    did the seller tell you which year's Nov 5th?
  • 1
    @kraator forgot to ask :( damn it!
  • 1
    @netikras Find a view where the page content has a specific sentence if the SKU you're looking for is available, copy the URL into the curl param, copy the sentence into the grep param.
  • 1
    @netikras Don't mind me, I'm just covering up for not knowing unix with duct tape and an unbroken act of cleverness.
  • 0
    Don't they have an API for that?
  • 0
    Ryzen 5000?
  • 0
    @kamen naah, don't care about that :)
  • 1
    Some people enjoy a hard day.
    Me on the other hand let the tools do their job for me.

    https://chrome.google.com/webstore/...
  • 0
    @netikras It's a coincidence then.
Add Comment