Skip to content

Instantly share code, notes, and snippets.

@yatt
Created April 30, 2015 13:58
Show Gist options
  • Select an option

  • Save yatt/1419e6a3d44999afbb4c to your computer and use it in GitHub Desktop.

Select an option

Save yatt/1419e6a3d44999afbb4c to your computer and use it in GitHub Desktop.
link euler project problem to http://odz.sakura.ne.jp/
// ==UserScript==
// @name ScriptEuler
// @namespace http://d.hatena.ne.jp/yatt/
// @description link euler project problem to http://odz.sakura.ne.jp/
// @include https://projecteuler.net/archives*
// ==/UserScript==
(function(){
var lst = document.getElementsByClassName('id_column')
var prefix = 'http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%20'
for (var i = 1 ; i < lst.length; i++)
{
var no = lst[i].innerHTML
var a = document.createElement('a')
a.href = prefix + no
a.innerText = no
lst[i].innerText = ''
lst[i].appendChild(a)
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment