-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmisc_links.rb
85 lines (71 loc) · 2.55 KB
/
misc_links.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 2017 Patrick Fairbank. All Rights Reserved.
# @author [email protected] (Patrick Fairbank)
#
# Links for reaching miscellaneous FRC pages.
module FrcLinks
class Server < Sinatra::Base
# Redirects to the game documents page.
get /\/(d|docs?|documents?)(\/(\d+))?/i do
year = params["captures"][2]
if year && year != default_year.to_s
redirect "https://www.firstinspires.org/node/5331"
else
redirect "https://www.firstinspires.org/resource-library/frc/competition-manual-qa-system"
end
end
# Redirects to a specific rule in the manual.
get /\/(d|docs?|documents?)\/([A-Za-z])(\d+)/i do
rule_type = params["captures"][1].upcase
rule_number = params["captures"][2]
redirect "https://frc-qa.firstinspires.org/manual/rule/#{rule_type}/#{rule_number}"
end
# Redirects to the Kit of Parts page.
get /\/(k|kop|kitofparts)/i do
redirect "https://www.firstinspires.org/robotics/frc/kit-of-parts"
end
# Redirects to the Playing Field page.
get /\/(p|pf|playingfield)/i do
redirect "https://www.firstinspires.org/robotics/frc/playing-field"
end
# Redirects to the Team Updates page.
get /\/(u|updates)/i do
redirect "https://www.firstinspires.org/resource-library/frc/competition-manual-qa-system"
end
# Redirects to the FRC Blog.
get /\/(b|blog)/i do
redirect "https://community.firstinspires.org/topic/frc"
end
# Redirects to the FIRST Youth Protection Policy.
get /\/ypp/i do
redirect "https://www.firstinspires.org/resource-library/youth-protection-policy"
end
# Redirects to the FIRST Forums.
get /\/(f|forums?)/i do
redirect "https://forums.usfirst.org"
end
# Redirects to the Q&A system.
get /\/qa?/i do
redirect "https://frc-qa.firstinspires.org"
end
# Redirects to the FRC news page.
get /\/(n|news)/i do
redirect "https://www.firstinspires.org/node/4341"
end
# Redirects to the FRC calendar.
get /\/(cal|calendar)/i do
redirect "https://www.firstinspires.org/robotics/frc/calendar"
end
# Redirects to the FRC YouTube channel.
get /\/(y|youtube)/i do
redirect "https://www.youtube.com/user/FRCTeamsGlobal"
end
# Redirects to the Team/Volunteer/Student Team Information Management System.
get /\/(t|st|v)ims/i do
redirect "https://my.firstinspires.org/Dashboard/"
end
# Redirects to the The Blue Alliance homepage.
get /\/tba/i do
redirect "https://www.thebluealliance.com"
end
end
end