Ruby client for the Adobe Typekit API
$ gem install typekitty
You can access the Typekit API directly within Ruby or from your terminal.
To access the API within Ruby, continue reading; otherwise read the CLI section.
The API requires Ruby 1.9.3 or greater.
require 'typekitty'
The ENV['TYPEKIT_TOKEN']
variable represents a Typekit API Token, which you
may obtain on the tokens page.
The variable is used to authenticate requests. It must be set in order for your requests to authenticate properly.
An example could be:
ENV['TYPEKIT_TOKEN'] = 'my_secret_token'
Typekitty::Kit.all
=> [#<Typekitty::Kit analytics=false badge=true domains=["viralkitty.com"] families=[{"id"=>"llxb", "name"=>"Museo Slab", "slug"=>"museo-slab", "css_names"=>["museo-slab"], "css_stack"=>"\"museo-slab\",serif", "subset"=>"default", "variations"=>["n3", "i3", "n7", "i7"]}] id="gec4ttz" name="viralkitty">]
Typekitty::Kit.find 'gec4ttz'
=> #<Typekitty::Kit analytics=false badge=true domains=["viralkitty.com"] families=[{"id"=>"llxb", "name"=>"Museo Slab", "slug"=>"museo-slab", "css_names"=>["museo-slab"], "css_stack"=>"\"museo-slab\",serif", "subset"=>"default", "variations"=>["n3", "i3", "n7", "i7"]}] id="gec4ttz" name="viralkitty">
Typekitty::Library.all
=> [#<Typekitty::Library id="trial" link="/api/v1/json/libraries/trial" name="Trial Library">, #<Typekitty::Library id="personal" link="/api/v1/json/libraries/personal" name="Personal Library">, #<Typekitty::Library id="full" link="/api/v1/json/libraries/full" name="Full Library">]
The typekitty
gem includes a command-line interface for accessing the Typekit
API.
For usage and help:
$ typekitty
Commands:
typekitty help [COMMAND] # Describe available commands or one specific command
typekitty kit KIT_ID --token=TOKEN # Get information about the draft version of a kit
typekitty kits --token=TOKEN # Lists kits
typekitty libraries # Lists font libraries
Use Bundler to install the dependencies:
$ bundle install
$ rspec spec
We use Semantic Versioning; please read before cutting new releases.
The specs use VCR cassettes to record and replay actual HTTP requests from the Typekit API.
MIT