<commit_before>require 'rest-client'

class EventbriteAggregator
=begin
	include HTTParty
	base_uri "https://www.eventbriteapi.com/v3/"

  def initialize
    @options = { 
    	#:token 						=> Rails.application.secrets.eventbrite_token, 
    	:"location.latitude"		=> 53.2167, 
    	:"location.longitude"		=> 6.5667, 
    	:"start_date.range_start"	=> DateTime.now.to_s,
    	headers:{
    		#{}"Accept" =>  "application/json"
    		"Authorization"				=>  "Bearer #{Rails.application.secrets.eventbrite_token}"
    	}
    }
    puts @options
  end

  def fetch
  	raw_result = self.class.get("events/search/", @options)
  	result = JSON.parse(raw_result)
  end
=end
	def fetch
		params = {
	    	:"location.latitude"		=> 53.2167, 
	    	:"location.longitude"		=> 6.5667, 
	    	:"start_date.range_start"	=> DateTime.now.to_s
	    }

		RestClient.get "https://www.eventbriteapi.com/v3/events/search/", {params: params, accept: :json,  authorization: "Bearer #{Rails.application.secrets.eventbrite_token}"}
	end

end<commit_msg>working API request using rest-client<commit_after>require 'rest-client'

class EventbriteAggregator
=begin
	include HTTParty
	base_uri "https://www.eventbriteapi.com/v3/"

  def initialize
    @options = { 
    	#:token 						=> Rails.application.secrets.eventbrite_token, 
    	:"location.latitude"		=> 53.2167, 
    	:"location.longitude"		=> 6.5667, 
    	:"start_date.range_start"	=> DateTime.now.to_s,
    	headers:{
    		#{}"Accept" =>  "application/json"
    		"Authorization"				=>  "Bearer #{Rails.application.secrets.eventbrite_token}"
    	}
    }
    puts @options
  end

  def fetch
  	raw_result = self.class.get("events/search/", @options)
  	result = JSON.parse(raw_result)
  end
=end
	def fetch
		params = {
	    	"location.latitude"		=> 53.2167, 
	    	"location.longitude"		=> 6.5667, 
	    }

		RestClient.get "https://www.eventbriteapi.com/v3/events/search/", {params: params, accept: :json,  authorization: "Bearer #{Rails.application.secrets.eventbrite_token}"}
	end

end
{'fraction_non_alphanumeric': 0.14483440434997527, 'fraction_numerical': 0.023727137913989126, 'mean_word_length': 3.1646090534979425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '1455799', 'n_tokens_mistral': 829, 'n_tokens_neox': 751, 'n_words': 117}