Skip to content

Commit 9cc09be

Browse files
author
Chaitanya Vadrevu
committed
PlayTak Viewer
1 parent bac4428 commit 9cc09be

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

app/controllers/games_controller.rb

+11
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,15 @@ def ninjaviewer
221221
redirect_to 'http://ptn.ninja/#' + URI.encode(ptn)
222222
end
223223
end
224+
225+
def playtakviewer
226+
id = params[:id]
227+
games = Game.where('id = ?', id)
228+
229+
if(games.length == 1)
230+
game = games[0]
231+
ptn = get_ptn(game)
232+
redirect_to 'https://www.playtak.com/?load=' + URI.encode(ptn)
233+
end
234+
end
224235
end

app/views/games/_search_form.html.haml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%h5.text-center Games before 23rd April 5:00 PM UTC are anonymized and won't appear when searching with player name
2-
%h5.text-center Please don't scrape this site. You can directly download the database <a href="/games_anon.db">here</a> (29 MB) (updated on Oct 22) but note that the notation is in server's format.
2+
%h5.text-center Please don't scrape this site. You can directly download the database <a href="/games_anon.db">here</a> (30 MB) (updated on Oct 26) but note that the notation is in server's format.
33
%h6.text-center The link above will be updated with latest database every day at 5:00 PM UTC.
44

55
%br

app/views/games/search.html.haml

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@
5656
%br
5757
= link_to "View", view_game_path(game.id), target: "_blank"
5858
%td
59-
= link_to "ptn.ninja", ninjaviewer_game_path(game.id), target: "_blank"
59+
= link_to "PlayTak", playtakviewer_game_path(game.id), target: "_blank"
6060
%br
6161
= link_to "jsfiddle", ptnviewer_game_path(game.id), target: "_blank"
62+
%br
63+
= link_to "ptn.ninja", ninjaviewer_game_path(game.id), target: "_blank"
6264
//-else
6365
// No results found!
6466

config/routes.rb

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
get 'view'
88
get 'ptnviewer'
99
get 'ninjaviewer'
10+
get 'playtakviewer'
1011
end
1112
end
1213

0 commit comments

Comments
 (0)