mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-01-08 01:51:58 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
22 lines
549 B
Nu
22 lines
549 B
Nu
#!/usr/bin/env nu
|
|
let baseurl = 'https://www.schiit.co.uk/'
|
|
let pages = ['headphone-amps' 'dacs' 'schiit-gaming-products' 'power-amplifiers' 'preamps' 'upgrades' 'accessories-cables' 'schiit%20graded%20stock']
|
|
|
|
# Simple script to check stock of https://schiit.co.uk store
|
|
def main [] {
|
|
$pages | par-each { |page|
|
|
http get ($baseurl + $page)
|
|
|query web -q '.price, .stock, .product-item h5'
|
|
|str trim
|
|
|group 3
|
|
|each {
|
|
|x| {
|
|
name: $x.0,
|
|
avail: $x.1,
|
|
price: $x.2
|
|
}
|
|
}
|
|
}
|
|
|sort-by avail
|
|
}
|