public
Description: Tool to generate dot file based on wikipedia usage
Homepage:
Clone URL: git://github.com/schleyfox/wikimapper.git
wikimapper / wiki_mapper.user.js
100644 27 lines (24 sloc) 0.673 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==UserScript==
// @name WikiMapper
// @namespace http://code.pixelmachine.org
// @description makes a graph of your Wikipedia Use
// @include http://en.wikipedia.org/wiki/*
// ==/UserScript==
 
var title_re = /http:\/\/en.wikipedia.org\/wiki\/(.*)$/
var referer
if(document.referrer) {
tmp = title_re.exec(document.referrer)
if(tmp)
referer = tmp[1]
}
var current = title_re.exec(document.location)[1]
 
if(referer && current) {
GM_xmlhttpRequest({method: 'GET',
url: 'http://localhost:9999/?from=' + escape(referer) +
'&to=' + escape(current)
})
} else {
GM_xmlhttpRequest({method: 'GET',
url: 'http://localhost:9999/?single=' + escape(current)
})
}