<commit_before>module Onebox
  module Engine
    class SmugMugOnebox
      include Engine
      include JSON

      matches do
        http
        words
        domain("smugmug")
        tld("com")
      end

      private

      def data
        binding.pry
        {
          url: @url,
          photographer: raw["author_name"],
          caption: raw["title"],
          image: raw["url"]
        }
      end<commit_msg>add url conversion to smugmug api url using oembed #79<commit_after>module Onebox
  module Engine
    class SmugMugOnebox
      include Engine
      include JSON

      matches do
        http
        words
        domain("smugmug")
        tld("com")
      end

      def url
        "https://api.smugmug.com/services/oembed/?url=#{CGI.escape(@url)}&format=json"
      end

      private

      def data
        {
          url: @url,
          photographer: raw["author_name"],
          caption: raw["title"],
          image: raw["url"]
        }
      end
{'fraction_non_alphanumeric': 0.09017223910840932, 'fraction_numerical': 0.002026342451874367, 'mean_word_length': 1.526854219948849, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3500471', 'n_tokens_mistral': 293, 'n_tokens_neox': 282, 'n_words': 71}