Jump to content

Module:Rivals.com recruit url

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Frietjes (talk | contribs) at 18:26, 6 October 2016 (Created page with '-- This module forms a rivals.com URL for Template:College athlete recruit end local p = {} -- This is a list of schools without dedicated URLs local search...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

-- This module forms a rivals.com URL for [[Template:College athlete recruit end]]
local p = {}

-- This is a list of schools without dedicated URLs
local searchname = {
	['butler'] = 'Butler',
}

function p.url(frame)
	local t = (frame.args['team'] or ''):lower()
	local y = tonumber(frame.args['year'] or '') or ''
	local sport = frame.args['sport'] or 'football'
	local sn = searchname[t]
	if sn then
		return 'https://n.rivals.com/search#?formValues=%257B%2522sport%2522:%2522' + (sport == 'basketball' and 'Basketball' or 'Football')
			+ '%2522,%2522recruit_year%2522:' + y + ',%2522college.common_name%2522:%255B%2522' + sn 
			+ '%2522%255D,%2522page_number%2522:1,%2522position_group.abbreviation%2522:%2522%2522,%2522'
			+ 'position.abbreviation%2522:%2522%2522,%2522'
			+ 'status%2522:%255B%2522signed%2522,%2522verbal%2522%255D%257D'
	else
		return 'http://' + t + '.rivals.com/commitments/' + sport + '/' + y
	end
end

return p