<commit_before>require 'flickr'
class FlickrMacro < FilteredColumn::Macros::Base
  KEY = '<KEY>'

  def self.filter(attributes, inner_text = '', text = '')
    img     = attributes[:img]
    size    = attributes[:size] || "square"
    style   = attributes[:style]
    caption = attributes[:caption]
    title   = attributes[:title]
    alt     = attributes[:alt]

    flickr      = Flickr.new(KEY)
    flickrimage = Flickr::Photo.new(img)
    sizes       = flickrimage.sizes

    details   = sizes.find {|s| s['label'].downcase == size.downcase } || sizes.first
    width     = details['width']
    height    = details['height']
    imageurl  = details['source']
    imagelink = flickrimage.url

    caption ||= flickrimage.description
    title   ||= flickrimage.title
    alt     ||= title<commit_msg>remove coderay, allow setting of flickr key<commit_after>require 'flickr'
class FlickrMacro < FilteredColumn::Macros::Base
  KEY = '<KEY>'

  def self.filter(attributes, inner_text = '', text = '')
    img     = attributes[:img]
    size    = attributes[:size] || "square"
    style   = attributes[:style]
    caption = attributes[:caption]
    title   = attributes[:title]
    alt     = attributes[:alt]

    flickr      = Flickr.new(attributes[:key] || KEY)
    flickrimage = Flickr::Photo.new(img)
    sizes       = flickrimage.sizes

    details   = sizes.find {|s| s['label'].downcase == size.downcase } || sizes.first
    width     = details['width']
    height    = details['height']
    imageurl  = details['source']
    imagelink = flickrimage.url

    caption ||= flickrimage.description
    title   ||= flickrimage.title
    alt     ||= title
{'fraction_non_alphanumeric': 0.13768115942028986, 'fraction_numerical': 0.0, 'mean_word_length': 2.954653937947494, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2275675', 'n_tokens_mistral': 522, 'n_tokens_neox': 505, 'n_words': 106}