new file: s/contact.tpl.html
new file: s/favicon.gif new file: s/how.tpl.html modified: s/index.tpl.html modified: s/item.tpl.html modified: s/style.css modified: src/main.js deleted: s/irccat.gif
This commit is contained in:
parent
244fa1053f
commit
ade9d27c18
0
s/contact.tpl.html
Normal file
0
s/contact.tpl.html
Normal file
BIN
s/favicon.gif
Normal file
BIN
s/favicon.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 229 B |
32
s/how.tpl.html
Normal file
32
s/how.tpl.html
Normal file
@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>f0ck me! but how?</title>
|
||||
<link rel="stylesheet" type="text/css" href="./s/style.css" />
|
||||
<link rel="icon" type="image/gif" href="./s/favicon.gif" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="irc">
|
||||
<h4>irc.n0xy.net +6697 (ssl only) #f0ck</h4>
|
||||
<p><code>SHA256 Fingerprint=10:2F:90:45:53:B9:1E:F8:7A:B4:7B:AE:03:70:4C:84:70:7A:A9:EE:11:49:2B:79:A0:7A:2D:01:B2:E6:0F:41</code></p>
|
||||
<p>Don't have a desktop client? Why not join our Network via webirc? <a href="https://webirc.n0xy.net/#f0ck" target="about_blank">>>webirc.n0xy.net</a></p>
|
||||
<div class="page-header">
|
||||
<h4>IRC Rules</h4>
|
||||
</div>
|
||||
<ol>
|
||||
<li>Do not spread CP of any kind at this server (loli included!).</li>
|
||||
<li>Do not attack against users or infrastructure of this server.</li>
|
||||
<li>Do not attack against any systems throught this server.</li>
|
||||
<li>Do not spread worms, viruses or any other kind of malware at this server.</li>
|
||||
<li>Do not try to sell, buy, or spread credit-card, banking etc info at this server!</li>
|
||||
<li>Do not spread content, that is at the moment illegal at the hosting country, or your country.</li>
|
||||
<li>Don't be an asshole, no butthurt allowed beyond this line ^-^</li>
|
||||
</ol>
|
||||
<h4>how to f0ck you ask?</h4>
|
||||
<p>f0ck will f0ck any media link posted in the channel ending with: jpg|gif|png|webm|mp3|mp4</p>
|
||||
<p>If you don't want f0ck to f0ck it put !ignore behind your link. Example: https://retard-journal.com/stupidshit.png !ignore</a>
|
||||
<p>f0ck will only f0ck media links with the maximum size of 30MB</p>
|
||||
<p>Don't let f0ck f0ck childporn :( ... please</p>
|
||||
<a href="/">return to main</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -3,11 +3,11 @@
|
||||
<head>
|
||||
<title>f0ck me!</title>
|
||||
<link rel="stylesheet" type="text/css" href="./s/style.css">
|
||||
<link rel="favicon" type="image/png" href="./s/faviconf0ck.png" />
|
||||
<link rel="icon" type="image/gif" href="./s/favicon.gif" />
|
||||
</head>
|
||||
<body>
|
||||
{% for item in items %}
|
||||
<div class="mrhankyisteinneger"><a href="./{{ item }}"><img src="./t/{{ item }}.png" /></a></div>
|
||||
<div class="navbar"><a href="/">f0ck.me</a> | <a href="/how" target="_blank">how to</a> | <a href="/contact" target="_blank">Contact</a></div><br />
|
||||
{% for item in items %}<div class="mrhankyisteinneger"><a href="./{{ item }}"><img src="./t/{{ item }}.png" /></a></div>
|
||||
{% endfor %}
|
||||
</html>
|
||||
</body>
|
BIN
s/irccat.gif
Normal file
BIN
s/irccat.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 226 KiB |
@ -3,11 +3,11 @@
|
||||
<head>
|
||||
<title>{{ id }} - f0ck.me</title>
|
||||
<link rel="stylesheet" type="text/css" href="./s/style.css">
|
||||
<link rel="favicon" type="image/png" href="./s/faviconf0ck.png" />
|
||||
<link rel="icon" type="image/gif" href="./s/favicon.gif" />
|
||||
</head>
|
||||
<body>
|
||||
<h4><a href="/">f0ck.me</a></h4>
|
||||
<div class="id">[ID: {{ id }} | by: {{ username }}]</div>
|
||||
<div class="return"><a href="/" title="return to main">f0ck.me</a></div><br />
|
||||
<div class="medium">
|
||||
{% if item == "video" %}
|
||||
<video src="{{ dest }}" style="max-width: 1024px" autoplay controls loop></video>
|
||||
@ -19,7 +19,7 @@
|
||||
<img src="{{ dest }}" style="max-width: 1024px" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="controls">controls für vor und zurück :^)</div>
|
||||
<div class="controls">controls für vor und zurück :^)</div><br />
|
||||
<div class="info">
|
||||
<span class="src">src: <a href="{{ src }}" target="_blank">{{ src }}</a></span><br />
|
||||
<span class="dest">dest: {{ dest }}</span><br />
|
||||
|
17
s/style.css
17
s/style.css
@ -9,40 +9,43 @@ a > img {
|
||||
border: 2px solid #4c4a4a;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #9f0;
|
||||
}
|
||||
a:hover {
|
||||
color: #74c100;
|
||||
}
|
||||
|
||||
.medium {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.info {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.id {
|
||||
text-align: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.mrhankyisteinneger {
|
||||
padding: 0;
|
||||
display: block;
|
||||
margin: 0 0 4px 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mrhankyisteinneger:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.controls {
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
.navbar {
|
||||
text-align: center;
|
||||
}
|
||||
.return {
|
||||
text-align: center;
|
||||
}
|
||||
.irc {
|
||||
margin: 20px;
|
||||
}
|
34
src/main.js
34
src/main.js
@ -47,7 +47,7 @@ bot.on('motd', (e) => {
|
||||
|
||||
bot.on('message', (e) => {
|
||||
var orig = e.message;
|
||||
if(orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi) && e.channel.getName() == "#f0ck") { // shitpostcatcher
|
||||
if(orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi)/* && e.channel.getName() == "#f0ck"*/) { // shitpostcatcher
|
||||
if(!orig.match(/\!ignore$/)) {
|
||||
var tmp = orig.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links
|
||||
tmp.forEach((entry,i,a) => {
|
||||
@ -95,6 +95,10 @@ bot.on('message', (e) => {
|
||||
var tmp = getUser(e.user.getNick(), e.network);
|
||||
setTimeout(()=>{ e.reply(tmp); }, 1500);
|
||||
}
|
||||
else if(orig.match(/^\!reload tpl$/)) {
|
||||
getTpls();
|
||||
e.reply("templates reloaded");
|
||||
}
|
||||
});
|
||||
|
||||
var getUser = (u, n) => {
|
||||
@ -172,7 +176,6 @@ http.createServer((req, res) => {
|
||||
var url = req.url.split("/")[1];
|
||||
if(filePath == './')
|
||||
filePath = './index.html';
|
||||
|
||||
var extname = String(path.extname(filePath)).toLowerCase();
|
||||
var contentType = 'text/html';
|
||||
var mimeTypes = {
|
||||
@ -240,8 +243,18 @@ http.createServer((req, res) => {
|
||||
res.end(tpl(data), 'utf-8');
|
||||
});
|
||||
}
|
||||
else if(filePath == "./how") {
|
||||
var tpl = swig.compile(templates.how);
|
||||
res.writeHead(200, { 'Content-Type': 'text/html' });
|
||||
res.end(tpl(), 'utf-8');
|
||||
}
|
||||
else if(filePath == "./contact") {
|
||||
var tpl = swig.compile(templates.contact);
|
||||
res.writeHead(200, { 'Content-Type': 'text/html' });
|
||||
res.end(tpl(), 'utf-8');
|
||||
}
|
||||
else if(filePath.match(/^\.\/(b|s|t)\/.*/)) { // file
|
||||
contentType = mimeTypes[extname] || 'application/octect-stream';
|
||||
contentType = mimeTypes[extname];
|
||||
switch(contentType) {
|
||||
case "video/webm":
|
||||
case "video/mp4":
|
||||
@ -280,7 +293,7 @@ http.createServer((req, res) => {
|
||||
}
|
||||
}
|
||||
else {
|
||||
res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length });
|
||||
res.writeHead(200, { 'Content-Type': contentType, 'Content-Length': content.length, 'Cache-Control': 'max-age=2592000, public' });
|
||||
res.end(content, 'utf-8');
|
||||
}
|
||||
});
|
||||
@ -290,7 +303,7 @@ http.createServer((req, res) => {
|
||||
if(error) {
|
||||
if(error.code == 'ENOENT') {
|
||||
res.writeHead(200, { 'Content-Type': contentType });
|
||||
res.end('404 - file not found', 'utf-8');
|
||||
res.end('404 - f0ck you', 'utf-8');
|
||||
}
|
||||
else {
|
||||
res.writeHead(500);
|
||||
@ -305,14 +318,16 @@ http.createServer((req, res) => {
|
||||
}
|
||||
else { // errorpage
|
||||
res.writeHead(404);
|
||||
res.end('404 - not found', 'utf-8');
|
||||
res.end('404 - f0ck you', 'utf-8');
|
||||
}
|
||||
}).listen(cfg.webserver.port);
|
||||
|
||||
var getTpls = () => {
|
||||
templates = {
|
||||
"index": fs.readFileSync("./s/index.tpl.html", "utf-8"),
|
||||
"item": fs.readFileSync("./s/item.tpl.html", "utf-8")
|
||||
"item": fs.readFileSync("./s/item.tpl.html", "utf-8"),
|
||||
"how": fs.readFileSync("./s/how.tpl.html", "utf-8"),
|
||||
"contact": fs.readFileSync("./s/contact.tpl.html", "utf-8")
|
||||
};
|
||||
};
|
||||
getTpls();
|
||||
@ -330,9 +345,8 @@ var generateThumbs = () => {
|
||||
exec('ffmpegthumbnailer -i'+e.dest+' -o'+outdir+e.id+'.png -a', (error) => {
|
||||
if(error) {
|
||||
bot.send("#f0ck", "failed thumbnail for "+e.id+" ("+e.mime+")", 'n0xy');
|
||||
fs.unlink(outdir+e.id+'.png');
|
||||
fs.copySync('./s/mp3.png', outdir+e.id+'.png');
|
||||
// Standardthumb reinkopieren
|
||||
fs.unlink(outdir+e.id+'.png'); //
|
||||
fs.copySync('./s/mp3.png', outdir+e.id+'.png'); // copy standardthumbnail
|
||||
}
|
||||
else {
|
||||
bot.send("#f0ck", "generated thumbnail for "+e.id+" ("+e.mime+")", 'n0xy');
|
||||
|
Loading…
Reference in New Issue
Block a user