Module:Rivals.com recruit url explained

-- This module forms a rivals.com URL for local p =

-- Known schools with dedicated URLslocal webname =

-- Known schools without dedicated urls or simple search stringslocal searchname =

local function ucfirst(ta) local t1 = mw.ustring.gsub(ta, '^(%w)(.*)$', '%1') or local t2 = mw.ustring.gsub(ta, '^(%w)(.*)$', '%2') or ta return t1:upper .. t2end

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'

if webname[t] then return 'http://' .. t .. '.rivals.com/commitments/' .. sport .. '/' .. y else local sn = searchname[t] or ucfirst(t) sn = mw.ustring.gsub(sn, '([a-z])state$', '%1%%2520State') 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' endend

return p