<commit_before>require 'yaml'
require 'uri'

class PoddbClient
  module Downloading


    def titleize(s, maxlength=20) 
      s.gsub(/\W+/, '-')[0,maxlength].sub(/-$/, '')
    end

    def download(item_id)
      puts "Downloading podcast item #{item_id}"
      response = `curl -s #{SERVER}/item/#{item_id}/download`
      data = YAML::load(response)<commit_msg>strip leading non-word-character from episode title<commit_after>require 'yaml'
require 'uri'

class PoddbClient
  module Downloading


    def titleize(s, maxlength=20) 
      s.gsub(/\W+/, '-')[0,maxlength].sub(/-$/, '').sub(/^-/, '')
    end

    def download(item_id)
      puts "Downloading podcast item #{item_id}"
      response = `curl -s #{SERVER}/item/#{item_id}/download`
      data = YAML::load(response)
{'fraction_non_alphanumeric': 0.16923076923076924, 'fraction_numerical': 0.007692307692307693, 'mean_word_length': 3.26775956284153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5193305', 'n_tokens_mistral': 272, 'n_tokens_neox': 260, 'n_words': 59}