Add Lua plugin host, built-in amazon plugin and dibs check.

Sandboxed gopher-lua with time, memory and call-stack limits from
[sandbox], a goquery-backed doc API, price parsing, and the 'check',
'plugin test' and 'fixtures' commands. Sellers are first_party,
fulfilled (shipped by the shop) or third_party, and items accept
fulfilled by default; used-only offers are not available. Plugin tests
run on real pages that 'dibs fixtures' fetches into an untracked
directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
OverlordandClaude Bot committed 2026-10-14 01:46:03 +02:00
1 parent f90ef18f90
commit bb010356a0
28 files changed
+2096 -26

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
# Real Amazon pages the amazon plugin is tested on. `dibs fixtures` fetches
# them into pages/ (not tracked), together with the report dibs made for
# each. Pages change: when a case stops showing what its note says, pick
# another product.
#
# Still wanted: a page sold by Amazon itself, and a preorder.
[[case]]
name = "out-of-stock-de"
url = "https://www.amazon.de/dp/B0HMX2FSTF"
note = "Metro 2039 CE (Xbox), currently unavailable, no offer at all"
[[case]]
name = "out-of-stock-uk"
url = "https://www.amazon.co.uk/dp/B0HM497GJJ"
note = "Metro 2039 CE (PC), currently unavailable, prices in GBP"
[[case]]
name = "fulfilled-de"
url = "https://www.amazon.de/dp/B0DK51S84Z"
note = "Silkland cable, sold by Silkland-DE, shipped by Amazon"
[[case]]
name = "fulfilled-de-2"
url = "https://www.amazon.de/dp/B076WS2WJ6"
note = "UGREEN enclosure, sold by a marketplace seller, shipped by Amazon"
[[case]]
name = "used-only-de"
url = "https://www.amazon.de/dp/B0948LPGNG"
note = "Metro Exodus Complete (PS5), only a used copy in the buybox: not available"
[[case]]
name = "not-found-de"
url = "https://www.amazon.de/dp/B0NOTREAL1"
note = "no such product: Amazon's 404 dog page"
+20
View File
@@ -0,0 +1,20 @@
# How the amazon plugin's normalize() rewrites product URLs. Anything that is
# not an Amazon product URL on a supported TLD stays as it is.
normalize = [
{ in = "https://www.amazon.de/dp/B0HMX2FSTF", out = "https://www.amazon.de/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.de/dp/B0HMX2FSTF?th=1", out = "https://www.amazon.de/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.de/dp/B0HMX2FSTF/ref=sr_1_1?th=1&psc=1", out = "https://www.amazon.de/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.de/Metro-2039-Collectors-Edition/dp/B0HMX2FSTF", out = "https://www.amazon.de/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.co.uk/gp/product/B0HM497GJJ", out = "https://www.amazon.co.uk/dp/B0HM497GJJ" },
{ in = "https://www.amazon.co.uk/gp/product/B0HM497GJJ/ref=ppx_yo_dt_b_asin", out = "https://www.amazon.co.uk/dp/B0HM497GJJ" },
{ in = "https://www.amazon.fr/gp/aw/d/B0HMX2FSTF", out = "https://www.amazon.fr/dp/B0HMX2FSTF" },
{ in = "https://amazon.it/dp/b0hmx2fstf", out = "https://www.amazon.it/dp/B0HMX2FSTF" },
{ in = "HTTPS://WWW.AMAZON.ES/dp/B0HMX2FSTF#reviews", out = "https://www.amazon.es/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.nl/dp/B0HMX2FSTF", out = "https://www.amazon.nl/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.com/exec/obidos/ASIN/B0HMX2FSTF", out = "https://www.amazon.com/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.co.jp/dp/B0HMX2FSTF", out = "https://www.amazon.co.jp/dp/B0HMX2FSTF" },
{ in = "https://www.amazon.de/s?k=metro", out = "https://www.amazon.de/s?k=metro" },
{ in = "https://www.amazon.de/dp/B0HMX2FSTFX", out = "https://www.amazon.de/dp/B0HMX2FSTFX" },
{ in = "https://www.notamazon.de/dp/B0HMX2FSTF", out = "https://www.notamazon.de/dp/B0HMX2FSTF" },
]