Open open-game-nexusmods in Script Kit
/*# Open game page in nexusmods.comLets the user select and open the page of a game in [nexusmods.com](https://www.nexusmods.com/).*/// Name: Open game page in nexusmods.com// Description: Lets the user select and open the page of a game in nexusmods.com.// Author: Ricardo Gonçalves Basseteimport '@johnlindquist/kit'interface Category {category_id: numbername: stringparent_category: boolean | number}interface Game {approved_date: numberauthors: numbercategories: Category[]domain_name: stringdownloads: numberfile_count: numberfile_endorsements: numberfile_views: numberforum_url: stringgenre: stringid: numbermods: numbername: stringnexusmods_url: string}const GAMES_API = 'https://api.nexusmods.com/v1/games.json'const API_KEY = await env('NEXUSMODS_API_KEY', {panel: md(`## Get a [Nexus Mods Personal API Key](https://next.nexusmods.com/settings/api-keys)`),ignoreBlur: true,secret: true,})const { data } = await get<Game[]>(GAMES_API, {headers: {accept: 'application/json',apikey: API_KEY,},})const target = await arg({placeholder: 'Select Game',choices: data.map(game => {return {name: game.name,description: game.nexusmods_url,value: game.nexusmods_url,img: `https://staticdelivery.nexusmods.com/Images/games/4_3/tile_${game.id}.jpg`,height: 250,}}),})open(target)