From 88b653aa44f3e1fc0b3ae707930bfefe0762960d Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 25 Apr 2024 20:14:10 -0500 Subject: [PATCH] scryfall: better moxfield words --- extra/scryfall/scryfall.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extra/scryfall/scryfall.factor b/extra/scryfall/scryfall.factor index d0b03eb52c..1eef4b3f09 100644 --- a/extra/scryfall/scryfall.factor +++ b/extra/scryfall/scryfall.factor @@ -29,7 +29,7 @@ CONSTANT: scryfall-images-path "resource:scryfall-images/" : load-scryfall-json ( type path -- uri ) [ find-scryfall-json "download_uri" of ] dip - 10 days download-outdated-as path>json ; + 30 days download-outdated-as path>json ; MEMO: mtg-oracle-cards ( -- json ) "oracle_cards" scryfall-oracle-json-path load-scryfall-json ; @@ -764,9 +764,11 @@ MEMO: get-moxfield-deck ( public-id -- json ) ] bi ; +: moxfield-decks-for-username ( username -- json ) + get-moxfield-user "data" of ; + : moxfield-random-deck-for-username ( username -- json ) - get-moxfield-user - "data" of + moxfield-decks-for-username random "publicId" of get-moxfield-deck json>moxfield-deck ; @@ -779,4 +781,4 @@ MEMO: get-moxfield-deck ( public-id -- json ) moxfield-latest-deck-for-username deck. ; : moxfield-latest-deck-and-sideboard-for-username. ( username -- ) - moxfield-latest-deck-for-username deck-and-sideboard. ; \ No newline at end of file + moxfield-latest-deck-for-username deck-and-sideboard. ; -- 2.34.1