Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@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
``` -
My concept was that you can grep for the purchase button and rely on the fact that grep returns 1 if no rows match.
-
@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 ;)
-
@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.
-
@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 -
@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.
-
@netikras Don't mind me, I'm just covering up for not knowing unix with duct tape and an unbroken act of cleverness.
-
C0D4669534ySome people enjoy a hard day.
Me on the other hand let the tools do their job for me.
https://chrome.google.com/webstore/...
Related Rants
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....?
random
waiting eagerly
polling