1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

Update nuschiit.nu (#208)

Simplified html parsing
This commit is contained in:
Yethal 2022-04-15 16:41:50 +02:00 committed by GitHub
parent 4a1ccf0e43
commit 7e59e5b9dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,11 +6,11 @@ let pages = ['headphone-amps' 'dacs' 'schiit-gaming-products' 'power-amplifiers'
def main [] {
$pages|par-each {|page|
fetch $"($baseurl)($page)"
|query web -q 'div.caption' -m
|par-each {|item|
$item
|query web -q 'p.stock, h5'
|rotate --ccw name availability
|query web -q '.price, .stock, .product-item h5'
|group 3
|each {
str trim
|rotate --ccw name availability price
}
|flatten
}