From: Doug Coleman Date: Fri, 26 Apr 2024 01:14:10 +0000 (-0500) Subject: scryfall: better moxfield words X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain scryfall: better moxfield words --- 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. ;