<commit_before>require 'net/http'
require 'net/https'


json = Net::HTTP.get(URI.parse('https://www.googleapis.com/books/v1/volumes?q=isbn:9780984999309'))
puts json<commit_msg>ruby ruby<commit_after>require 'open-uri'
require 'json'

isbn = ARGV[0]

if (isbn.to_s == '') 
    puts "usage: ruby findbook.rb <isbn>" 
else
    url = "https://www.googleapis.com/books/v1/volumes?q=isbn:" + isbn
    json = open(url, 'Accept-Encoding' => '').read
    volumeInfo = JSON.parse(json)["items"][0]["volumeInfo"];
    title = volumeInfo["title"] 
    subtitle = volumeInfo["subtitle"] 
    authors = volumeInfo["authors"].join()
    thumbnail = volumeInfo["imageLinks"]["smallThumbnail"] 
    puts "\"#{title}\";\"#{subtitle}\";\"#{authors}\";\"#{thumbnail}\""
end


{'fraction_non_alphanumeric': 0.20767195767195767, 'fraction_numerical': 0.022486772486772486, 'mean_word_length': 4.607407407407408, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '7011421', 'n_tokens_mistral': 292, 'n_tokens_neox': 277, 'n_words': 42}