<commit_before><commit_msg>[bin] script to download bing.com's picture of day<commit_after>#!/usr/bin/env ruby

require 'open-uri'

picture_folder = File.expand_path("~/Pictures/pod")

page = open('http://cn.bing.com/', 'User-Agent' => "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0").read
img_url = page.to_s.scan(/g_img={url: \"(.*?)\",/).last.first
img_url = (img_url.start_with?('//') ? 'http' : 'http://www.bing.com') + img_url
file_name = File.join(picture_folder, img_url.scan(/([^\/]+)/).last.first)

File.open(file_name, 'wb') do |fp|
    fp.write open(img_url).read
    fp.close
end

Process.spawn('fbsetbg', file_name)

{'fraction_non_alphanumeric': 0.21745788667687596, 'fraction_numerical': 0.033690658499234305, 'mean_word_length': 4.589743589743589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7404446', 'n_tokens_mistral': 284, 'n_tokens_neox': 266, 'n_words': 44}