Sha256: e62cd5d4fef788de327f683ba9fe67a273140022409eeeb5119c40d83a39e7ff

Contents?: true

Size: 610 Bytes

Versions: 1

Compression:

Stored size: 610 Bytes

Contents

module MyAnimeList
  class Manga

    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/manga/search.xml?q=#{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.2 lib/myanimelist/manga.rb