<commit_before># encoding=utf-8
require "nyanimefinder/version"
require 'nokogiri'
require 'net/http'

module Nyanimefinder
  class WorldArt
    
    def search_anime query
      url      = "http://myanimelist.net/anime.php?q=#{query}"
      response = Net::HTTP.get_response(URI.parse(url))
      
      if response.code == '302'
        # if we got here, then we got single result
        # and were redirected to a page with anime
        redirect = URI.parse(response.header['location'])
        response = Net::HTTP.get_response(redirect)
        return parse_single_result response.body
      else
        return parse_multi_result response.body
      end<commit_msg>WorldArt added link to search<commit_after># encoding=utf-8
require "nyanimefinder/version"
require 'nokogiri'
require 'net/http'

#http://www.world-art.ru/search.php?public_search=slayers&global_sector=animation


module Nyanimefinder
  class WorldArt
    
    def search_anime query
      url      = "http://myanimelist.net/anime.php?q=#{query}"
      response = Net::HTTP.get_response(URI.parse(url))
      
      if response.code == '302'
        # if we got here, then we got single result
        # and were redirected to a page with anime
        redirect = URI.parse(response.header['location'])
        response = Net::HTTP.get_response(redirect)
        return parse_single_result response.body
      else
        return parse_multi_result response.body
      end
{'fraction_non_alphanumeric': 0.09474412171507607, 'fraction_numerical': 0.005532503457814661, 'mean_word_length': 2.9643835616438357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1980290', 'n_tokens_mistral': 436, 'n_tokens_neox': 426, 'n_words': 106}