Sha256: 7ef22af2dbd590e7e60effdf64182d7ab456269b68d0666c47c5fa3efd7b3499

Contents?: true

Size: 663 Bytes

Versions: 2

Compression:

Stored size: 663 Bytes

Contents

#! /usr/bin/env ruby

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'yaml'
require 'thanos'

api_key_file = "#{File.dirname(__FILE__)}/api_keys.yml"

public_key = YAML.load_file(api_key_file)['public_api_key']
private_key = YAML.load_file(api_key_file)['private_api_key']

Thanos.authenticate do |key|
  key.public_api_key = public_key
  key.private_api_key = private_key
end

client = Thanos::Client.new

hulk = client.characters.find_by_name 'Hulk'
puts hulk.id
puts hulk.name
puts hulk.description
puts hulk.resource_uri
puts hulk.urls.first.url
puts hulk.thumbnail.full_path

avengers = client.series.find_by_name 'The Avengers'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thanos-0.6.0 spikes/call_marvel_via_thanos.rb
thanos-0.5.0 spikes/call_marvel_via_thanos.rb