Le site arthur.bebou.netlib.re - retour accueil
git clone git://bebou.netlib.re/arthur.bebou
Log | Files | Refs |
en.cr (296B)
1 corres = {} of String => String 2 3 File.read_lines("corres").each_slice(2) do |pair| 4 corres[ pair[1] ] = pair[0] 5 end 6 7 old_urls = %r{ 8 (?<url> https://sws.geonames.org/ 9 (?<key> [^/]+ ) 10 /about.rdf) 11 }x 12 13 content = File.read("A").gsub(old_urls) do 14 corres[$~["key"]]? || $~["url"] 15 end 16 puts content