works with the 3 keywords (but still no analysis done)

master
Fabien Benetou 14 years ago
parent a168da802a
commit a61918c78b
  1. 46
      greasemonkey/tos_inspector.user.js

@ -1,40 +1,56 @@
// ==UserScript== // ==UserScript==
// @name VirtualBlinders // @name TOS Inspector
// @namespace Utopiah // @namespace Utopiah
// @description Stay focus, damnit! // @description Understand and help other to understand cryptic terms of services
// @include *facebook.com* // @include *facebook.com*
// ==/UserScript== // ==/UserScript==
/*
Work on the wiki side
service template
tos monitoring tools
diff tools
patterns to look for
...
*/
serviceName="Facebook"; serviceName="Facebook";
serviceAlternatives="http://diaspora.com"; serviceAlternatives='<a href="http://joindiaspora.com">Diaspora</a>';
wikiUrl="http://self/devpim/" tosPath="TrackedTOS";
wikiUrl="http://self/devpim/";
GM_xmlhttpRequest({ GM_xmlhttpRequest({
method: "GET", method: "GET",
url: wikiUrl+"pub/tos_status", url: wikiUrl+tosPath+"/"+serviceName+"?action=source",
onload: function(response) { onload: function(response) {
task = response.responseText; tos = response.responseText;
responseCheck(tos); GM_setValue("tosLastResult",responseCheck(tos));
} }
}); });
function responseCheck(tos) { function responseCheck(tos) {
if (tos == 'ok\n' ){ if (tos == 'Ok' ){
tos_rendering = '<font color="green">TOS ok :)</font>'; return '<img src="'+wikiUrl+'pub/green-light.png" /><font color="green">TOS ok :)</font>';
} }
if (tos == 'meh\n'){ if (tos == 'Meh'){
tos_rendering = '<font color="orange">Warning</font> (consider those settings)'; return '<img src="'+wikiUrl+'pub/orange-light.png" /><font color="orange">Warning</font> (consider those settings)';
} }
if (tos == 'bad\n'){ if (tos == 'Bad'){
tos_rendering = '<font color="red">BAD TOS!</font> (try '+serviceAlternatives+'instead)'; return '<img src="'+wikiUrl+'pub/red-light.png" /><font color="red">BAD TOS!</font> (try '+serviceAlternatives+' instead)';
} }
} }
tosRendering = GM_getValue("tosLastResult",'<img src="'+wikiUrl+'pub/orange-light.png" /><font color="orange">Warning</font> ToS not found, please consider <a href="'+wikiUrl+tosPath+'/'+serviceName+'">adding it</a>.');
var myDiv = document.createElement('div'); var myDiv = document.createElement('div');
myDiv.id = "GM_PIM_Window"; myDiv.id = "GM_TOS_Inspector_Window";
myDiv.innerHTML += "<p class=\"tos_render\">"+tosRendering+"<ul>" myDiv.innerHTML += "<p class=\"tos_render\">"+tosRendering+"<ul>"
+"<li>Tune your settings<li/>" +"<li>Tune your settings<li/>"
+"<li>Contribute to <a href=\""+wikiUrl+serviceName+"\">the ToS wiki page for this service</a>.</li>" +"<li>Contribute to <a href=\""+wikiUrl+tosPath+"/"+serviceName+"\">the ToS wiki page for this service</a>.</li>"
+"</ul></p>"; +"</ul></p>";
boxcss = 'position:fixed; right:5px; top:50px; background-color:white; z-index:1; opacity:0.9;'; boxcss = 'position:fixed; right:5px; top:50px; background-color:white; z-index:1; opacity:0.9;';
boxcss += 'padding:2px; margin:1px;'; boxcss += 'padding:2px; margin:1px;';

Loading…
Cancel
Save