Created
March 21, 2022 18:21
-
-
Save Lomanic/11ad8f534c96e56b47e85a227397187f to your computer and use it in GitHub Desktop.
Download previous words from sutom.nocle.fr
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
require 'base64' | |
require 'date' | |
require 'open-uri' | |
# https://github.com/pil0u/sutom-tob/commit/263e26ec15019f1f41582dc3480b54c2d23266af | |
def uri_mot_sutom(jour) | |
origine = Date.new(2022, 1, 7) | |
aujourdhui = origine + jour | |
s = "34ccc522-c264-4e51-b293-fd5bd60ef7aa-#{aujourdhui}" | |
s_enc = Base64.encode64(s).gsub("\n", '') | |
"https://sutom.nocle.fr/mots/#{s_enc}.txt" | |
end | |
for i in 1..74 do | |
URI.open(uri_mot_sutom(i)) do |txt| | |
File.open("./#{"%04d" % i}.txt", "wb") do |file| | |
file.write(txt.read) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment