Created
February 3, 2024 15:44
-
-
Save lannonbr/1a12f52dd75c7746936afdff23a5c1b3 to your computer and use it in GitHub Desktop.
ScriptKit script to track Paldean Fates TCGPlayer market price and see if it ever drops below a certain price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Tinkaton Price | |
import "@johnlindquist/kit"; | |
import pokemon from "pokemontcgsdk"; | |
pokemon.configure({ apiKey: process.env["POKEMON_TCG_API_TOKEN"] }); | |
const cardId = "sv4pt5-167"; | |
const belowPrice = 3; | |
const card = await pokemon.card.find(cardId); | |
const price = card.tcgplayer.prices.holofoil.market; | |
await div( | |
` | |
<div class="p-2"> | |
<div class="flex"> | |
<img class="w-40" src="${card.images.small}"/> | |
<div class="ml-4"> | |
<h1>Tinkaton (Paldean Fates)</h1> | |
<p class="text-lg mt-4">Market Price: $${price} ${ | |
price < belowPrice | |
? '<span class="text-green-400">Below purchase price</span>' | |
: '<span class="text-red-400">Above purchase price</span>' | |
} ($${belowPrice.toFixed(2)})</p> | |
</div> | |
</div> | |
</div> | |
` | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment