Sha256: 0c7088e1385d8fa0371cafe112d5119bbf104336b1ee1a3e51d5f37add921740
Contents?: true
Size: 622 Bytes
Versions: 1
Compression:
Stored size: 622 Bytes
Contents
module MyAnimeList class Anime def initialize(options={}) @myanimelist_username = options[:username] @myanimelist_password = options[:password] end def search(name) get_search(name) end def get_search(name) response = RestClient::Request.new( method: :get, url: "http://myanimelist.net/api/anime/search.xml?q=#{CGI::escape name}", user: @myanimelist_username, password: @myanimelist_password, content_type: :xml ).execute parse_xml response end def parse_xml(response) Hash.from_xml response end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
myanimelist-0.0.3 | lib/myanimelist/anime.rb |