User:Lidia.Pereira/PTSP/SCPL: Difference between revisions
(Created page with "<div style="width:70%"> '''CybersTalk''' CybersTalk is a browser plug-in which pops up chat windows on your screen for every third-party website tracking you. It is a play o...") |
No edit summary |
||
Line 53: | Line 53: | ||
iframe.id = "trackerchat"; | iframe.id = "trackerchat"; | ||
iframe.src = "http://headroom.pzwart.wdka.hro.nl/~lpereira/cgi-bin/trackerscrape.cgi?url="+uniqueArray[0]; | iframe.src = "http://headroom.pzwart.wdka.hro.nl/~lpereira/cgi-bin/trackerscrape.cgi?url="+uniqueArray[0]; | ||
document.getElementById('trackerchat').setAttribute("style","width: 190px; height: 255px; bottom:0; right:15px; z-index: 555555;"); | document.getElementById('trackerchat').setAttribute("style","width: 190px; height: \ | ||
255px; bottom:0; right:15px; z-index: 555555;"); | |||
document.getElementById('trackerchat').style.position = 'fixed'; | document.getElementById('trackerchat').style.position = 'fixed'; | ||
body.insertBefore(closingDiv, body.firstChild) | body.insertBefore(closingDiv, body.firstChild) | ||
document.getElementById('close').setAttribute("style","width:23px; height:23px;background-color:#0099FF;z-index:999999;right:20px; bottom:227px; border:none; color: #FFFFFF; font-weight:bold; font-size:13px;") | document.getElementById('close').setAttribute("style","width:23px; height:23px;\ | ||
background-color:#0099FF;z-index:999999;right:20px; bottom:227px; border:none; color: #FFFFFF;\ | |||
font-weight:bold; font-size:13px;") | |||
document.getElementById('close').style.position = 'fixed'; | document.getElementById('close').style.position = 'fixed'; | ||
document.getElementById('close').setAttribute("onclick","closeWin()"); | document.getElementById('close').setAttribute("onclick","closeWin()"); | ||
Line 77: | Line 80: | ||
</syntax> | </syntax> | ||
<syntaxhighlight lang="python"> | |||
#!/usr/bin/env python | |||
#-*- coding:utf-8 -*- | |||
import cgi, urllib | |||
import cgitb; cgitb.enable() | |||
import urlparse, time, random | |||
import urllib2 | |||
print "Content-Type: text/html" | |||
print | |||
print """ | |||
<!DOCTYPE html> | |||
<html> | |||
<head> | |||
<style> | |||
body { | |||
width: 190px; | |||
height: 255px; | |||
overflow: hidden; | |||
} | |||
#footer { | |||
width: 190px; | |||
height: 255px; | |||
background: white; | |||
left:0; | |||
top:0; | |||
position:fixed; | |||
} | |||
h1{ | |||
color: white; | |||
font-size:13px; | |||
font-family: sans-serif; | |||
text-indent: 1%; | |||
} | |||
#chatname { | |||
padding:2%; | |||
background-color:#0099FF; | |||
} | |||
#chat, #warning, #rpl { | |||
text-indent: 5%; | |||
margin-top:5%; | |||
font-family:sans-serif; | |||
font-size:11px; | |||
} | |||
#warning{ | |||
color:red; | |||
font-weight:bold; | |||
} | |||
#rpl{ | |||
text-decoration: line-through; | |||
} | |||
#reply{ | |||
position:absolute; | |||
bottom:0; | |||
width:190px; | |||
} | |||
iframe{ | |||
width: 177px; | |||
height: 255px; | |||
} | |||
#hiddenform { | |||
position:absolute; | |||
bottom:55px; | |||
width:190px; | |||
} | |||
</style> | |||
</head> """ | |||
form = cgi.FieldStorage() | |||
tracker = form.getvalue("url") | |||
reply = form.getvalue("reply","").strip().lower() | |||
track = form.getvalue("track","").strip().lower() | |||
chc = form.getvalue("choice","") | |||
if not reply and tracker != None: | |||
prs = urlparse.urlparse(tracker) | |||
trck = prs.netloc | |||
possible = ["Hi, u free tonite?", "Feeling funky, babe?", "Want to have some fun?", "U lonely?"] | |||
choice = random.choice(possible) | |||
if reply: | |||
trck = track | |||
choice = chc | |||
print"""<body> | |||
<div id='footer'> | |||
<div id='chatname'> | |||
<h1>"""+trck+"""</h1> | |||
</div> | |||
<p id='chat'> """+choice+""" </p>""" | |||
if reply: | |||
print """<p id='rpl'>""" +reply+"""</p>""" | |||
print """<p id='warning'> This is a one-way conversation! </p>""" | |||
print """<form id='reply'> | |||
<input type='text' name='reply' placeholder = 'Reply...' size='25' value='"""+reply+"""'/> | |||
<input type='hidden' name='track' size='25' value='"""+trck+"""'/> | |||
<input type='hidden' name='choice' size='25' value='"""+choice+"""'/> | |||
</form>""" | |||
print""" </body> | |||
</html>""" | |||
</syntax> | |||
</div> | </div> |
Revision as of 02:05, 30 June 2014
CybersTalk
CybersTalk is a browser plug-in which pops up chat windows on your screen for every third-party website tracking you. It is a play on cyberstalker common behaviour.
<syntaxhighlight lang="javascript"> var head = document.getElementsByTagName("head")[0]; var body = document.getElementsByTagName("body")[0]; var jquery = "http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"; var jqueryui ="http://code.jquery.com/ui/1.10.4/jquery-ui.js"; var jquerymin = "http://code.jquery.com/jquery-1.11.0.min.js"; var script1 = document.createElement("SCRIPT"); var script2 = document.createElement("SCRIPT"); var script3 = document.createElement("SCRIPT"); head.appendChild(script1); head.appendChild(script2); head.appendChild(script3); script1.src = jquery; script2.src = jqueryui; script3.src = jquerymin; script1.type = "text/javascript"; script2.type = "text/javascript"; script3.type = "text/javascript"; var links = document.getElementsByTagName("link"); var linkSrc = []; var closingDiv = document.createElement("button"); var text=document.createTextNode("x") closingDiv.appendChild(text) closingDiv.id = "close";
for (var i = 0; i < links.length; i++) {
var check = links[i].href.substring(7, links[i].href.length-1).split("/"); var hoolahoop = "http://"+check[0] if (links[i].href.substring(0, 4) === "http") { if (hoolahoop != "http://"){ linkSrc.push(hoolahoop); console.log(hoolahoop);} } }
uniqueArray = linkSrc.filter(function(elem, pos) {
return linkSrc.indexOf(elem) == pos;
})
function janelas(){
var iframe = document.createElement("iframe"); body.insertBefore(iframe,body.firstChild); iframe.id = "trackerchat"; iframe.src = "http://headroom.pzwart.wdka.hro.nl/~lpereira/cgi-bin/trackerscrape.cgi?url="+uniqueArray[0]; document.getElementById('trackerchat').setAttribute("style","width: 190px; height: \
255px; bottom:0; right:15px; z-index: 555555;");
document.getElementById('trackerchat').style.position = 'fixed'; body.insertBefore(closingDiv, body.firstChild) document.getElementById('close').setAttribute("style","width:23px; height:23px;\
background-color:#0099FF;z-index:999999;right:20px; bottom:227px; border:none; color: #FFFFFF;\
font-weight:bold; font-size:13px;") document.getElementById('close').style.position = 'fixed'; document.getElementById('close').setAttribute("onclick","closeWin()"); uniqueArray.splice(0,1)
}
if(linkSrc!=0){
janelas();
}
function closeWin() {
document.getElementById('close').setAttribute("style","display: none") document.getElementById('trackerchat').setAttribute("style","display: none") if (uniqueArray.length>0){ janelas(); }
}
</syntax>
<syntaxhighlight lang="python">
- !/usr/bin/env python
- -*- coding:utf-8 -*-
import cgi, urllib import cgitb; cgitb.enable() import urlparse, time, random import urllib2
print "Content-Type: text/html" print print """
<!DOCTYPE html> <html> <head> <style> body { width: 190px; height: 255px; overflow: hidden; } #footer {
width: 190px; height: 255px; background: white; left:0; top:0; position:fixed; }
h1{
color: white; font-size:13px; font-family: sans-serif; text-indent: 1%;
}
- chatname {
padding:2%; background-color:#0099FF;
}
- chat, #warning, #rpl {
text-indent: 5%; margin-top:5%; font-family:sans-serif; font-size:11px;
}
- warning{
color:red; font-weight:bold;
}
- rpl{
text-decoration: line-through;
}
- reply{
position:absolute; bottom:0; width:190px;
} iframe{
width: 177px; height: 255px;
}
- hiddenform {
position:absolute; bottom:55px; width:190px;
}
</style>
</head> """
form = cgi.FieldStorage() tracker = form.getvalue("url") reply = form.getvalue("reply","").strip().lower() track = form.getvalue("track","").strip().lower() chc = form.getvalue("choice","")
if not reply and tracker != None:
prs = urlparse.urlparse(tracker) trck = prs.netloc
possible = ["Hi, u free tonite?", "Feeling funky, babe?", "Want to have some fun?", "U lonely?"] choice = random.choice(possible)
if reply:
trck = track choice = chc
print"""<body>