<commit_before>require 'rubygems'
require 'bundler'
Bundler.require

require 'net/http'

configure do
  set :protection, except: [:frame_options]
end

require 'active_support/all'

MEETUP_API_KEY = ENV['MEETUP_API_KEY']
get '/meetup/:meetup_group_url' do
  headers 'Access-Control-Allow-Origin' => '*'
  url = "http://api.meetup.com/2/events?offset=0&format=json&limited_events=False" +
    "&group_urlname=#{params['meetup_group_url']}" +
    "&photo-host=public&page=200&fields=&order=time&desc=false&status=upcoming&sign=true" +
    "&key=#{MEETUP_API_KEY}"

  res = Net::HTTP.get(URI(url))

  parsed = JSON.parse(res)
  @results = parsed['results']

  if params['filter']
    @results.select! { |res| res['name'] =~ /#{params['filter']}/i }
  end

  @show_from_to = true if params['show_from_to']

  # The limit is one greater than the required limit, because of the
  # header row. The limit is enforced only through CSS.
  @limit = params['limit'] ? params['limit'].to_i + 1 : 26

  haml :calendar
end

get '/' do
  "Please visit /meetup/YourMeetupGroupURL"
end<commit_msg>Linting with standard rubocop cops<commit_after># frozen_string_literal: true

require 'rubygems'
require 'bundler'
Bundler.require

require 'net/http'

configure do
  set :protection, except: [:frame_options]
end

require 'active_support/all'

MEETUP_API_KEY = ENV['MEETUP_API_KEY']
get '/meetup/:meetup_group_url' do
  headers 'Access-Control-Allow-Origin' => '*'
  url = 'http://api.meetup.com/2/events?offset=0&format=json&limited_events=False' \
        "&group_urlname=#{params['meetup_group_url']}" \
        '&photo-host=public&page=200&fields=&order=time&desc=false&status=upcoming&sign=true' \
        "&key=#{MEETUP_API_KEY}"

  res = Net::HTTP.get(URI(url))

  parsed = JSON.parse(res)
  @results = parsed['results']

  if params['filter']
    @results.select! { |res| res['name'] =~ /#{params['filter']}/i }
  end

  @show_from_to = true if params['show_from_to']

  # The limit is one greater than the required limit, because of the
  # header row. The limit is enforced only through CSS.
  @limit = params['limit'] ? params['limit'].to_i + 1 : 26

  haml :calendar
end

get '/' do
  'Please visit /meetup/YourMeetupGroupURL'
end
{'fraction_non_alphanumeric': 0.1548154815481548, 'fraction_numerical': 0.0072007200720072, 'mean_word_length': 4.759067357512953, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6221660', 'n_tokens_mistral': 835, 'n_tokens_neox': 798, 'n_words': 166}