<commit_before>class Dvd < ActiveRecord::Base
  dragonfly_accessor :image
  acts_as_taggable_on :tags

  validates :rating, allow_nil: true, :numericality => { :greater_than => 0, :less_than_or_equal_to => 5 }
  validates :playback_time, allow_nil: true, :numericality => { :greater_than_or_equal_to => 0 }

  has_many :episodes
  has_many :bookmarks

  def self.get_yoopsie(barcode)
    #barcode = '717951000842'
    url = "http://www.yoopsie.com/query.php?query=" + barcode
    doc = Nokogiri::HTML(open(url))

    td = doc.css('.info_image').search('td')[0]
    title = td.search('a')[0]['title']
<commit_msg>Fixed bug with Yoopsie by requiring open-uri.<commit_after>class Dvd < ActiveRecord::Base
  dragonfly_accessor :image
  acts_as_taggable_on :tags

  validates :rating, allow_nil: true, :numericality => { :greater_than => 0, :less_than_or_equal_to => 5 }
  validates :playback_time, allow_nil: true, :numericality => { :greater_than_or_equal_to => 0 }

  has_many :episodes
  has_many :bookmarks

  def self.get_yoopsie(barcode)
    require 'open-uri'
    #barcode = '717951000842'
    url = "http://www.yoopsie.com/query.php?query=" + barcode
    doc = Nokogiri::HTML(open(url))

    td = doc.css('.info_image').search('td')[0]
    title = td.search('a')[0]['title']

{'fraction_non_alphanumeric': 0.1462079749804535, 'fraction_numerical': 0.026583268178264268, 'mean_word_length': 4.663716814159292, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, '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': '2833438', 'n_tokens_mistral': 512, 'n_tokens_neox': 478, 'n_words': 88}