Rakefile: the extraction of PGN is fixed in accordance with new 'lichess' layout.

This commit is contained in:
vonavi 2014-02-05 02:34:47 +02:00
parent 4cb558788f
commit 1fecc222c7

View File

@ -140,7 +140,7 @@ namespace :pgn do
require 'open-uri' require 'open-uri'
doc = Nokogiri::HTML open ENV['url'] doc = Nokogiri::HTML open ENV['url']
link = doc.css('a.view_pgn_toggle').first link = doc.css('.fen_pgn a').first
pgn_url = 'http://lichess.org' + link['href'] pgn_url = 'http://lichess.org' + link['href']
str = URI.parse(pgn_url).read str = URI.parse(pgn_url).read
File.open('temp.pgn', 'w') { |f| f.write str } File.open('temp.pgn', 'w') { |f| f.write str }