Skip to content

ahmattox/cube-cobra-google-sheets

Repository files navigation

Cube Cobra for Google Sheets

Fetch Cube lists from Cube Cobra within Google Sheets.

Installation

To install, copy and paste the script to a sheet, or copy this example Sheet.

To add the script, in a Sheet go to "Extensions" > "Apps Scripts". Copy and paste the contents of cube-cobra-google-sheets.js into the text field and save.

Usage

The script adds two functions to fetch a Cube's list of cards and metadata about the Cube.

Screenshot of Sheet with Cube Cobra formula

=CUBECOBRA_LIST(url, fields)

Pass in the URL or ID of a Cube and the columns you want to fetch. Cards will fill in across rows starting with the row with the formula, and columns with the specified attributes.

The fields are case insensitive and can be space or underscore separated. Some aliases are handled, e.g. Name, Card, card_name, or cmc, mv, or Mana Value. See card-attributes.txt for a list of attributes.

Fields can be specified with a row or column of the sheet, or passed directly to the formula:

=CUBECOBRA_LIST("regular", { "name", "cmc" } )

List Order

Cards are sorted in a 'normal' Magic way by color, type, and then mana value. You can use sheet formulas on the fetched values or edit the script directly to change the sort.

Up-to-date Lists

The Cube is fetched dynamically so if you make changes to the list on CC those changes will automatically appear when you open a sheet referencing it. If you want to keep a specific list that wont change (or will load quicker), copy and paste the resulting cells.

Cube Metadata

Cube metadata works the same way for attributes about the cube.

=CUBECOBRA_METADATA("regular", { "name", "cardCount", "imageName" })

Notes

This repository is not affiliated with or endorsed by Cube Cobra. Find more tools for Magic, and especially Cube, on Lucky Paper. Inspiration thanks to Scryfall's sheet integration.

Questions, issues, or want to expand this repo? Find me on Twitter or Discord.

About

Fetch Cube Cobra lists from Google Sheets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published