Skip to content

Instantly share code, notes, and snippets.

@birukoff
Last active February 15, 2021 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save birukoff/b9939dee045379b033b3fdc8901122ec to your computer and use it in GitHub Desktop.
Save birukoff/b9939dee045379b033b3fdc8901122ec to your computer and use it in GitHub Desktop.
Monitors listing of all GeForce 3080 cards at Komplett, and alerts when at least one them is in stock.
{
"client": {
"local": 1,
"type": 11,
"version": "1.18.5"
},
"data": [
{
"name": "GeForce RTX 3080 - Komplett.no",
"uri": "https://www.komplett.no/category/10412/datautstyr/pc-komponenter/skjermkort?nlevel=10000%C2%A728003%C2%A710412&sort=PriceAsc%3AASCENDING&hits=192&cnet=Grafikkprosessor_A00247%20%20%C2%A7NVIDIA%20GeForce%20RTX%203080",
"config": "{\"selections\":[{\"frames\":[{\"index\":0,\"excludes\":[],\"includes\":[{\"type\":\"xpath\",\"expr\":\"//main[@id='MainContent']/div[contains(@class,'container')]//div[@class='search-result']//form[contains(@class,'list')]\"}]}],\"dynamic\":true,\"delay\":0}],\"regexp\":{\"expr\":\"Varenr: \\\\d+\\\\n(?=(?:(?!Varenr).)+(?:stk\\\\. på lager))\",\"flags\":\"gis\"},\"ignoreEmptyText\":false,\"includeStyle\":false,\"dataAttr\":\"text\"}",
"tags": [],
"content_type": 2,
"state": 40,
"schedule": "{\"type\":\"RANDOM\",\"params\":{\"interval\":10800,\"min\":180,\"max\":600}}",
"ts": "2021-01-30T16:33:14.711Z",
"rule": "{\"type\":2,\"op\":1,\"rules\":[{\"type\":1,\"contentType\":2,\"rule\":{\"type\":1,\"params\":{}}}]}"
}
]
}
@birukoff
Copy link
Author

Notes:

  1. In URL &hits=192 is absolutely required to load dynamic content. Without it Komplett will load only around 20 results.
  2. The main idea: use regex to generate a list of SKU that are currently in stock; alert only when new entries appear in this list.

@V33m
Copy link

V33m commented Feb 15, 2021

Do you plan to add more sites such as Power, Elkjøp, netonnet and so on? For example, Power has 13 different versions of RTX 3080 (https://www.power.no/search/?q=rtx%203080). So, it makes it much better to do the same thing as with Komplett compared to checking each of them.

Last, thanks for the script! Looking forward to try it out and see if I'm finally able to get my hands on the new series 👍

@birukoff
Copy link
Author

@V33m I do not have any plans to add other sites. The more sites, the more maintenance. Since I have already got a card, it is hard to justify the effort.

@V33m
Copy link

V33m commented Feb 15, 2021

Sure, no problem. Thanks again for the script. Hopefully Komplett receives more RTX 3080 cards in the close future :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment