<commit_before>class MatchesController < ApplicationController
	before_action :set_tournament, only: [:index, :update]

	# GET /matches
	# GET /matches.json
	require 'httparty'
	require 'json'
	require 'delayed_job'

	def index
		@matches = @tournament.matches
		# width of SVG
		@width = 300 * (Math.log2(@matches.count).floor + 1);
		# height of SVG
		@height = 200 * 2**Math.log2(@matches.count).floor + 100;
	end

	def get_riot_info
		if signed_in?

			#current user information
			response = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/summoner/by-name/#{current_user.user_name}?api_key=ad539f86-22fd-474d-9279-79a7a296ac38")

			id = response["#{current_user.user_name.downcase}"]['id']

			#recent game information
			recent = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/game/by-summoner/#{response["#{current_user.user_name.downcase}"]['id']}/recent?api_key=ad539f86-22fd-474d-9279-79a7a296ac38")

			game_id = recent["games"][0]["gameId"]

			#remote_user_id = 6651654651354
			#remove_user_name = TeslasMind
			#How to Add
			#how do I access

			#members of most recent game id's
			player1 = recent["games"][0]["fellowPlayers"][0]["summonerId"]
			player2 = recent["games"][0]["fellowPlayers"][1]["summonerId"]
			player3 = recent["games"][0]["fellowPlayers"][2]["summonerId"]
			player4 = recent["games"][0]["fellowPlayers"][3]["summonerId"]
			player5 = recent["games"][0]["fellowPlayers"][4]["summonerId"]
			player6 = recent["games"][0]["fellowPlayers"][5]["summonerId"]
			player7 = recent["games"][0]["fellowPlayers"][6]["summonerId"]
			player8 = recent["games"][0]["fellowPlayers"][7]["summonerId"]
			player9 = recent["games"][0]["fellowPlayers"][8]["summonerId"]
<commit_msg>MatchesController: define matches_url<commit_after>class MatchesController < ApplicationController
	before_action :set_tournament, only: [:index, :update]

	# GET /matches
	# GET /matches.json
	require 'httparty'
	require 'json'
	require 'delayed_job'

	def index
		@matches = @tournament.matches
		# width of SVG
		@width = 300 * (Math.log2(@matches.count).floor + 1);
		# height of SVG
		@height = 200 * 2**Math.log2(@matches.count).floor + 100;
	end

	# For compatability with the router assumptions made by ApplicationController#check_permission
	def matches_url
		set_tournament
		tournament_matches_path(@tournament)
	end

	def get_riot_info
		if signed_in?

			#current user information
			response = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/summoner/by-name/#{current_user.user_name}?api_key=ad539f86-22fd-474d-9279-79a7a296ac38")

			id = response["#{current_user.user_name.downcase}"]['id']

			#recent game information
			recent = HTTParty.get("https://prod.api.pvp.net/api/lol/na/v1.3/game/by-summoner/#{response["#{current_user.user_name.downcase}"]['id']}/recent?api_key=ad539f86-22fd-474d-9279-79a7a296ac38")

			game_id = recent["games"][0]["gameId"]

			#remote_user_id = 6651654651354
			#remove_user_name = TeslasMind
			#How to Add
			#how do I access

			#members of most recent game id's
			player1 = recent["games"][0]["fellowPlayers"][0]["summonerId"]
			player2 = recent["games"][0]["fellowPlayers"][1]["summonerId"]
			player3 = recent["games"][0]["fellowPlayers"][2]["summonerId"]
			player4 = recent["games"][0]["fellowPlayers"][3]["summonerId"]
			player5 = recent["games"][0]["fellowPlayers"][4]["summonerId"]
			player6 = recent["games"][0]["fellowPlayers"][5]["summonerId"]
			player7 = recent["games"][0]["fellowPlayers"][6]["summonerId"]
			player8 = recent["games"][0]["fellowPlayers"][7]["summonerId"]
			player9 = recent["games"][0]["fellowPlayers"][8]["summonerId"]

{'fraction_non_alphanumeric': 0.17706901292273852, 'fraction_numerical': 0.05609018421776189, 'mean_word_length': 5.638686131386861, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '1542418', 'n_tokens_mistral': 1633, 'n_tokens_neox': 1362, 'n_words': 196}