Add Meta Quest VR games to the Notion gaming library with cover art images
You are helping the user add Meta Quest VR games to their Notion gaming library. The user provides one or more game names as comma-separated arguments.
Parse $ARGUMENTS as a comma-separated list of game names. Trim whitespace from each name.
Repeat the following steps for each game in the list.
Run a Ruby one-liner to check if the game already exists in the Notion database:
bundle exec ruby -e '
require "dotenv/load"
require_relative "lib/gaming_library/notion_client"
notion = GamingLibrary::NotionClient.new(
api_key: ENV["NOTION_API_KEY"],
database_id: ENV["NOTION_DATABASE_ID"],
)
results = notion.fetch_games_by_name("GAME_NAME")
results.each do |page|
name = page.dig("properties", "Name", "title", 0, "text", "content")
platforms = (page.dig("properties", "Platforms", "multi_select") || []).map { |p| p["name"] }.join(", ")
puts "#{name} [#{platforms}] (#{page["id"]})"
end
puts "No matches found" if results.empty?
'
Search for a landscape-oriented cover art image URL for the game. Try these sources in order:
header_image or capsule_imagev5 URL (these are landscape 460x215 or 616x353 images). Preferred source.Prefer landscape images (wider than tall). Steam header images (capsule_imagev5 or URLs containing /header.jpg) are ideal.
Use AskUserQuestion to present:
Ask whether to proceed with the insertion, skip this game, or use a different image URL.
Run a Ruby one-liner to insert the game:
bundle exec ruby -e '
require "dotenv/load"
require_relative "lib/gaming_library/notion_client"
notion = GamingLibrary::NotionClient.new(
api_key: ENV["NOTION_API_KEY"],
database_id: ENV["NOTION_DATABASE_ID"],
)
game = {
name: "GAME_NAME",
slug: "",
platform: "Meta Quest",
format: "Digital",
image_url: "IMAGE_URL",
}
code = notion.insert_deku_deals_game(game: game, details: nil)
puts "Insert response: #{code}"
'
Replace GAME_NAME and IMAGE_URL with the actual values. If no image was found and the user chose to proceed without one, set image_url: nil.
A response code of 200 indicates success.
After processing all games, present a summary table:
| Game | Status | Image |
|---|---|---|
| Beat Saber | Added | (steam header) |
| SUPERHOT VR | Skipped (duplicate) | — |
| Puzzling Places | Failed (error msg) | — |