<commit_before>require "vendasta/ri/version"
require "httparty"

module Vendasta

	OPTIONS = {
  	:endpoint => 'https://reputation-intelligence-api.vendasta.com/api/v2'
	}

	module Ri

		include HTTParty

		def self.ipsum
			puts "hi"
			puts ENV["VENDASTA_RI_APIUSER"]
			puts ENV["VENDASTA_RI_APIKEY"]
  	end

  	## Accounts
  	def self.lookupAccounts # Lookup Accounts
	    response = HTTParty.get("#{OPTIONS[:endpoint]}/account/lookup/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"]})

	    if response.success?
	    	response = JSON.parse(response.body)
	    else
	      response = JSON.parse(response.body)
	    end
	  end

	  def self.getAccount(customerIdentifier) # Get Accounts by ID
	    response = HTTParty.get("#{OPTIONS[:endpoint]}/account/get/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

	    if response.success?
	    	response = JSON.parse(response.body)
	    else
	      response = JSON.parse(response.body)
	    end
	  end


	  ## Visibility
	  def self.lookupListings(customerIdentifier) # Lookup Listings
	  	response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/lookupListings/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

	  	if response.success?
	    	response = JSON.parse(response.body)
	    else
	      response = JSON.parse(response.body)
	    end
	  end

	  def self.lookupPossibleListings(customerIdentifier) # Lookup Possible Listings
	  	response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/lookupPossibleListings/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

	  	if response.success?
	    	response = JSON.parse(response.body)
	    else
	      response = JSON.parse(response.body)
	    end
	  end

	  def self.getVisibilityStats(customerIdentifier) # Get Visibility Stats
	  	response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/getStats/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

	  	if response.success?
	    	response = JSON.parse(response.body)
	    else
	      response = JSON.parse(response.body)
	    end
	  end

  end
end
<commit_msg>move stuff into blocks<commit_after>require "vendasta/ri/version"
require "httparty"

module Vendasta

	OPTIONS = {
  	:endpoint => 'https://reputation-intelligence-api.vendasta.com/api/v2'
	}

	module RI

		include HTTParty

		## Accounts
		module Accounts

			def self.ipsum
				puts "hi"
				puts ENV["VENDASTA_RI_APIUSER"]
				puts ENV["VENDASTA_RI_APIKEY"]
  		end

  		def self.lookupAccounts # Lookup Accounts
		    response = HTTParty.get("#{OPTIONS[:endpoint]}/account/lookup/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"]})

		    if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		  def self.getAccount(customerIdentifier) # Get Accounts by ID
		    response = HTTParty.get("#{OPTIONS[:endpoint]}/account/get/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

		    if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		end

	  ## Visibility
	  module Visibility

	  	def self.lookupListings(customerIdentifier) # Lookup Listings
		  	response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/lookupListings/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

		  	if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		  def self.lookupPossibleListings(customerIdentifier) # Lookup Possible Listings
		  	response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/lookupPossibleListings/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

		  	if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		  def self.getVisibilityStats(customerIdentifier) # Get Visibility Stats
		  	response = HTTParty.get("#{OPTIONS[:endpoint]}/visibility/getStats/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

		  	if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

	  end

	  ## Reviews
	  module Reviews

		  def self.getVisibilityStats(customerIdentifier, reviewId) # Get Reviews by ID
		  	response = HTTParty.get("#{OPTIONS[:endpoint]}/review/get/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier, :reviewId => reviewId})

		  	if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		  def self.searchReviews(customerIdentifier) # Search Reviews
		  	response = HTTParty.get("#{OPTIONS[:endpoint]}/review/search/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

		  	if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		  def self.searchReviews(customerIdentifier) # Search Reviews
		  	response = HTTParty.get("#{OPTIONS[:endpoint]}/review/search/", :query => {:apiUser => ENV["VENDASTA_RI_APIUSER"], :apiKey => ENV["VENDASTA_RI_APIKEY"], :customerIdentifier => customerIdentifier})

		  	if response.success?
		    	response = JSON.parse(response.body)
		    else
		      response = JSON.parse(response.body)
		    end
		  end

		end

  end
end

{'fraction_non_alphanumeric': 0.1293796207007393, 'fraction_numerical': 0.0003214400514304082, 'mean_word_length': 3.7540106951871657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 56, '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': '1731989', 'n_tokens_mistral': 2231, 'n_tokens_neox': 1931, 'n_words': 360}