<commit_before>require 'faraday'
require 'faraday_middleware'
require 'json'
require 'uri'

class Vine
  def initialize
    @client = Faraday.new(:url => "https://api.vineapp.com/")
  end

  def search_tag(t)
    tag = URI.escape(t)
    posts = @client.get "timelines/tags/#{tag}"
    body = JSON.parse posts.body
    urls = []
    body['data']['records'].each_with_index do |record, i|
      break if i + 1 == 30
      urls << record['videoLowURL']
    end
    urls
  end
end<commit_msg>Refectering.<commit_after>require 'faraday'
require 'faraday_middleware'
require 'json'
require 'uri'

class Vine
  def initialize
    @client = Faraday.new(:url => "https://api.vineapp.com/")
  end

  def search_tag(t)
    tag = URI.escape(t)
    posts = @client.get "timelines/tags/#{tag}"
    body = JSON.parse posts.body
    body['data']['records'].first(30).map{|x| x['videoLowURL']}
  end
end
{'fraction_non_alphanumeric': 0.154627539503386, 'fraction_numerical': 0.0056433408577878106, 'mean_word_length': 3.4797979797979797, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6290928', 'n_tokens_mistral': 329, 'n_tokens_neox': 311, 'n_words': 71}