You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
misc/pub/code/reverted_pim_links.user.js

81 lines
2.7 KiB

// ==UserScript==
// @name reverted PIM links
// @namespace Utopiah
// @description overlay so that a visited page indexed in a PIM displays a link back
// @include *
// @exclude *://mail.google.com/mail/*
// @require http://ecmanaut.googlecode.com/svn/trunk/lib/gm/$x$X.js
// ==/UserScript==
// the require script is a part of ecmanaut grand project
// to re-organize the world starting with the annoying interface to the DOM API
/*
* Script homepage : from http://userscripts.org/ somewhere?
*
* to do
* find a way (visiting a special URL?) to (re)generate the data store on demand (not at each boot)
* apply to Person/
* cf ealier idea http://wiki.seedea.org/Oimp/Socialannotating
* add links to the database
* note that date is optional but the source is not
* delicious-20100730.htm
* emails
* IRC/IM
34269 links using
for SCANNETWORK in $(ls ~/irclogs/); do grep http ~/irclogs/$SCANNETWORK/* | sed "s/.* <\(.*\)> .*http\(.*\)/http\2 \1 on $SCANNETWORK/"; done | wc -l
19881 freenode
5834 blinkenshell
4867 testing
2354 seedeabitlbee
1325 mozilla
7 rezosup
for SCANNETWORK in $(ls ~/irclogs/); do echo -n -e "$SCANNETWORK\t" && grep http ~/irclogs/$SCANNETWORK/* | sed "s/.* <\(.*\)> .*http\(.*\)/http\2 \1 on $SCANNETWORK/" | wc -l; done | awk '{print $2 "\t" $1}' | sort -n -r
*
*/
// configuration
var script_name = "rPIMlinks";
var PIM_URL = "http://fabien.benetou.fr/";
// actual script
//load URLs in data store (greasemonkey.scriptvals in about:config in prefs.js)
// load the entire set of links
// merging linksloaded_prefs.js to prefs.js
// C:\Documents and Settings\tyflser\Application Data\Mozilla\Firefox\Profiles\aosia15p.default
// e.g. user_pref("greasemonkey.scriptvals.Utopiah/reverted PIM links.rPIMlinks http://www.wikipedia.com/wiki/Simulacra_and_Simulation", "ReadingNotes/LeSpectateurEmancipe");
//everytime a page is loaded
//get the current URL
PIMpages = GM_getValue(script_name+" "+document.URL,"fail");
//if the current URL is in data store
if (PIMpages != "fail")
{
//display link
var pages = PIMpages.split(" ");
var myDiv = document.createElement('div');
while (page = pages.shift()){
myDiv.innerHTML += "<p class=\"GM_PIM_link\"><a href=\""+PIM_URL+page+"\">"+page+"</a></p> ";
}
document.body.appendChild(myDiv);
}
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle('');