From a61918c78b4f0ca7c30210ffa4e5d95b7da5564b Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Mon, 25 Jul 2011 19:39:51 +0200 Subject: [PATCH] works with the 3 keywords (but still no analysis done) --- greasemonkey/tos_inspector.user.js | 46 ++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/greasemonkey/tos_inspector.user.js b/greasemonkey/tos_inspector.user.js index f2594a2..3d76ba1 100644 --- a/greasemonkey/tos_inspector.user.js +++ b/greasemonkey/tos_inspector.user.js @@ -1,40 +1,56 @@ // ==UserScript== -// @name VirtualBlinders +// @name TOS Inspector // @namespace Utopiah -// @description Stay focus, damnit! +// @description Understand and help other to understand cryptic terms of services // @include *facebook.com* // ==/UserScript== +/* + +Work on the wiki side + service template + tos monitoring tools + diff tools + patterns to look for + ... + +*/ + serviceName="Facebook"; -serviceAlternatives="http://diaspora.com"; -wikiUrl="http://self/devpim/" +serviceAlternatives='Diaspora'; +tosPath="TrackedTOS"; +wikiUrl="http://self/devpim/"; GM_xmlhttpRequest({ method: "GET", - url: wikiUrl+"pub/tos_status", + url: wikiUrl+tosPath+"/"+serviceName+"?action=source", onload: function(response) { - task = response.responseText; - responseCheck(tos); + tos = response.responseText; + GM_setValue("tosLastResult",responseCheck(tos)); } }); + function responseCheck(tos) { - if (tos == 'ok\n' ){ - tos_rendering = 'TOS ok :)'; + if (tos == 'Ok' ){ + return 'TOS ok :)'; } - if (tos == 'meh\n'){ - tos_rendering = 'Warning (consider those settings)'; + if (tos == 'Meh'){ + return 'Warning (consider those settings)'; } - if (tos == 'bad\n'){ - tos_rendering = 'BAD TOS! (try '+serviceAlternatives+'instead)'; + if (tos == 'Bad'){ + return 'BAD TOS! (try '+serviceAlternatives+' instead)'; } } + tosRendering = GM_getValue("tosLastResult",'Warning ToS not found, please consider adding it.'); + + var myDiv = document.createElement('div'); -myDiv.id = "GM_PIM_Window"; +myDiv.id = "GM_TOS_Inspector_Window"; myDiv.innerHTML += "

"+tosRendering+"

"; boxcss = 'position:fixed; right:5px; top:50px; background-color:white; z-index:1; opacity:0.9;'; boxcss += 'padding:2px; margin:1px;';