Last active
January 5, 2021 00:18
-
-
Save thejambi/2ba5fac1341c8b807f10939863b1300b to your computer and use it in GitHub Desktop.
PlayTak.com current game to PTN Ninja Bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
var p1 = $('.player1-name:first').html(); var p2 = $('.player2-name:first').html(); var now = new Date(); var dt = (now.getYear()-100)+'.'+(now.getMonth()+1)+'.'+now.getDate()+' '+now.getHours()+'.'+getZero(now.getMinutes()); $('#download_notation').attr('download', p1+' vs '+p2+' '+dt+'.ptn'); var res=''; res += getHeader('Site', 'PlayTak.com'); res += getHeader('Date', '20'+(now.getYear()-100)+'.'+(now.getMonth()+1)+'.'+now.getDate()); res += getHeader('Player1', p1); res += getHeader('Player2', p2); res += getHeader('Size', board.size); res += getHeader('Result', board.result); res += '\r\n'; var count=1; $('#moveslist tr').each(function() { $('td', this).each(function() { var val = $(this).text(); res += val; if(count%3 === 0) res += '\r\n'; else res += ' '; count++; }) }); | |
window.open('http://ptn.ninja/' + encodeURIComponent(res),'_blank'); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment