Skip to content

Commit 6bf1dbb

Browse files
committed
inital design and code
0 parents  commit 6bf1dbb

File tree

8 files changed

+210
-0
lines changed

8 files changed

+210
-0
lines changed

index.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
$HASH="f6108c60ba96a6e4a1bf27abf1f9ce138188e384";
3+
$TRACKER="http%3A%2F%2Fdev.cbcdn.com%3A80%2Fipmagnet";
4+
?>
5+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
6+
<html xmlns="http://www.w3.org/1999/xhtml">
7+
<head>
8+
<title>ipmagnet</title>
9+
<link rel="icon" href="static/favicon.ico" type="image/x-icon" />
10+
<link rel="stylesheet" type="text/css" href="static/ipmagnet.css" />
11+
<script type="text/javascript" src="static/ajax.js"></script>
12+
<script type="text/javascript" src="static/ipmagnet.js"></script>
13+
<meta name="robots" content="noindex,nofollow" />
14+
<meta http-equiv="refresh" content="60; url=?hash=<?php print($HASH); ?>">
15+
</head>
16+
<body onload="ipmagnet.init();">
17+
<div id="title-wrap">
18+
<h1>ipMagnet</h1>
19+
</div>
20+
<div id="center-wrap">
21+
<div id="content-main">
22+
<div id="mission-statement">
23+
ipMagnet allows you to see which IP address your BitTorrent Client is handing out to it's peers and trackers!
24+
</div>
25+
Add this <a href="magnet:?xt=urn:btih:<?php print($HASH); ?>&dn=ipMagnet+Tracking+Link&tr=<?php print($TRACKER); ?>">Magnet link</a> to your downloads and watch this page.
26+
FYI, the address you've accessed this page with is <?php print($_SERVER["REMOTE_ADDR"]); ?>
27+
<div id="current-connections">
28+
<table id="conn-table">
29+
<tr>
30+
<th>Timestamp</th>
31+
<th>IP address</th>
32+
<th>User Agent</th>
33+
</tr>
34+
</table>
35+
</div>
36+
</div>
37+
38+
<div id="footer-text">
39+
<span id="status-line">Status: n/a <span id="status-text"></span></span>
40+
<span id="meta-footer">
41+
<a href="https://github.com/cbdevnet/magnetip">[source]</a>
42+
<a href="http://www.kopimi.com/kopimi/"><img src="static/kopimi.png"/></a>
43+
<a href="http://wtfpl.net/"><img src="static/wtfpl.png"/></a>
44+
</span>
45+
</div>
46+
</div>
47+
</body>
48+
</html>

ipmagnet.db3

4 KB
Binary file not shown.

static/ajax.js

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/**
2+
The awesome
3+
CodeBlue pseudo-cross-browser XHR/AJAX Code Library
4+
5+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
6+
Version 2, December 2004
7+
8+
Copyright (C) 2004 Sam Hocevar <[email protected]>
9+
10+
Everyone is permitted to copy and distribute verbatim or modified
11+
copies of this license document, and changing it is allowed as long
12+
as the name is changed.
13+
14+
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
15+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16+
17+
0. You just DO WHAT THE FUCK YOU WANT TO.
18+
*/
19+
20+
var ajax={
21+
/**
22+
Create a XHR Object.
23+
IE Compat code removed.
24+
*/
25+
ajaxRequest:function(){
26+
if (window.XMLHttpRequest){//every sane browser, ever.
27+
return new XMLHttpRequest();
28+
}
29+
else{
30+
return false;
31+
}
32+
},
33+
34+
/**
35+
Make an asynchronous GET request
36+
Calls /readyfunc/ with the request as parameter upon completion (readyState == 4)
37+
*/
38+
asyncGet:function(url,readyfunc,errfunc,user,pass){
39+
var request=new this.ajaxRequest();
40+
request.onreadystatechange=
41+
function(){
42+
if (request.readyState==4){
43+
readyfunc(request);
44+
}
45+
};
46+
47+
request.open("GET",url,true,user,pass);
48+
try{
49+
request.send(null);
50+
}
51+
catch(e){
52+
errfunc(e);
53+
}
54+
return request;
55+
},
56+
57+
/**
58+
Make an asynchronous POST request
59+
Calls /readyfunc/ with the request as parameter upon completion (readyState == 4)
60+
61+
/payload/ should contain the data to be POSTed in the format specified by contentType,
62+
by defualt form-urlencoded
63+
64+
65+
*/
66+
asyncPost:function(url,payload,readyfunc,errfunc,contentType,user,pass){
67+
contentType=contentType||"application/x-www-form-urlencoded";
68+
69+
var request=new this.ajaxRequest();
70+
request.onreadystatechange=
71+
function(){
72+
if (request.readyState==4){
73+
readyfunc(request);
74+
}
75+
};
76+
77+
request.open("POST", url, true, user, pass);
78+
request.setRequestHeader("Content-type", contentType);
79+
try{
80+
request.send(payload);
81+
}
82+
catch(e){
83+
errfunc(e);
84+
}
85+
return request;
86+
},
87+
88+
/**
89+
Perform a synchronous GET request
90+
This function does not do any error checking, so exceptions might
91+
be thrown.
92+
*/
93+
syncGet:function(url,user,pass){
94+
var request=new this.ajaxRequest();
95+
request.open("GET", url, false, user, pass);
96+
request.send(null);
97+
return request;
98+
},
99+
100+
/**
101+
Perform a synchronous POST request, with /payload/
102+
being the data to POST in the specified format (default: form-urlencoded)
103+
*/
104+
syncPost:function(url, payload, contentType, user, pass){
105+
contentType=contentType||"application/x-www-form-urlencoded";
106+
107+
var request=new this.ajaxRequest();
108+
request.open("POST", url, false, user, pass);
109+
request.setRequestHeader("Content-type", contentType);
110+
request.send(payload);
111+
return request;
112+
}
113+
};

static/favicon.ico

Whitespace-only changes.

static/ipmagnet.css

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
body{
2+
width:100%;
3+
height:100%;
4+
}
5+
6+
h1{
7+
padding:0;
8+
margin:0;
9+
display:inline-block;
10+
}
11+
12+
#center-wrap{
13+
width:90%;
14+
margin:auto;
15+
}
16+
17+
#content-main{
18+
border-radius:1em;
19+
background-color:#ccc;
20+
margin-top:1em;
21+
padding:2em;
22+
}
23+
24+
#title-wrap{
25+
text-align:center;
26+
}
27+
28+
#mission-statement{
29+
font-style:italic;
30+
margin-bottom:1em;
31+
text-align:center;
32+
font-size:90%;
33+
}
34+
35+
#current-connections{
36+
margin-top:2em;
37+
}
38+
39+
#conn-table{
40+
width:100%;
41+
}
42+
43+
#meta-footer{
44+
float:right;
45+
}
46+
47+
#status-line{
48+
float:left;
49+
}

static/ipmagnet.js

Whitespace-only changes.

static/kopimi.png

123 Bytes
Loading

static/wtfpl.png

1.2 KB
Loading

0 commit comments

Comments
 (0)