Parcourir la source

Added files via upload

Additions provided by OverCoder @ freenode ! :)
Sebastien Lemery il y a 10 ans
Parent
commit
cb25a72b29

+ 11 - 0
scripts/Cleaner Index/README.txt

@@ -0,0 +1,11 @@
+Just add .htaccess dark-style.css index.php and recache.php to your /www/ folder, to make the listing of files nicer. 
+
+chmod both .php files
+
+recache.php to rwxr----- (740)
+index.php to rwxr--r-- (744)
+
+Then refresh :)
+
+
+Thanks to OverCoder @ freenode for this addition.

+ 68 - 0
scripts/Cleaner Index/dark-style.css

@@ -0,0 +1,68 @@
+body {
+	background: #222222;
+	padding-left: 2%;
+	padding-right: 2%;
+}
+
+h1, h2, h3, h4, h5, h6, p, td, th {
+	color: #EEEEEE;
+	font-family: Consolas, monospace;
+}
+
+th {
+	text-align: center;
+	padding: 8px;
+	font-size: 1.1em;
+}
+
+td {
+	padding: 8px;
+}
+
+table {
+	width: 100%;
+	background: #333333;
+	text-align: center;
+	border: 0;
+}
+
+table tr:nth-child(even) {
+    background-color: #444444;
+}
+
+table tr:nth-child(odd) {
+    background-color: #333333;
+}
+
+table tr:hover {
+	background: #252525;
+	cursor: pointer;
+}
+
+h1.center, h2.center, h3.center, h4.center, h5.center, h6.center, p.center {
+	text-align: center;
+}
+
+a, a:visited {
+	color: #EEEEEE;
+}
+
+a:hover {
+	color:#DDDDDD;
+}
+
+table, tr, th, td {
+	border-collapse: collapse;
+}
+
+pre code {
+	border: 1px solid #555555;
+	border-radius: 5px;
+	background-color: #333333;
+	padding: 12px;
+	display: block;
+}
+
+a.nostyle {
+	text-decoration: none;
+}

+ 35 - 0
scripts/Cleaner Index/index.php

@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+	<title>PISG Index</title>
+	<link rel="stylesheet" type="text/css" href="dark-style.css">
+</head>
+<body>
+<h1 class="center">PISG Channels</h1>
+<table>
+<tr>
+	<th>Channel</th>
+	<th>Last updated</th>
+	<th>Users</th>
+</tr>
+<?php
+
+$cache = file_get_contents("index-cache.txt") or die("Cache file not found!");
+$channels = explode("\n", $cache);
+
+foreach ($channels as $channel) {
+	$data = explode("\001", $channel);
+	echo '<tr onclick="document.location = \'' . $data[0] . '\'">';
+	echo '<td>' . $data[1] . '</td>';
+	echo '<td>' . $data[2] . '</td>';
+	echo '<td>' . $data[3] . '</td>';
+	echo '</tr>';
+}
+
+?>
+
+</table>
+
+<h6 class="center">Index and API coded by OverCoder | Whatever here | All rights reserved</h6>
+</body>
+</html>

+ 26 - 0
scripts/Cleaner Index/recache.php

@@ -0,0 +1,26 @@
+<?php
+
+$files = array_diff(scandir('.'), array('..', '.'));
+$channels = array();
+foreach ($files as $file) {
+	if (substr_compare($file, ".html", -5, 5) === 0)
+		array_push($channels, $file);
+}
+$cache = fopen("index-cache.txt", "w");
+
+foreach ($channels as $channel) {
+	$html = new DOMDocument();
+	$html->loadHTML(file_get_contents($channel));
+
+	$name = explode(" @ ", $html->getElementsByTagName("title")->item(0)->textContent)[0];
+	$date = "";
+	$nicksCount = "";
+	$temp = $html->getElementById("pagetitle2");
+	if (!is_null($temp))
+		$date = explode("on ", $temp->textContent)[1];
+	$temp = $html->getElementById("pagetitle3");
+	if (!is_null($temp))
+		$usersCount = $temp->getElementsByTagName("b")->item(0)->textContent;
+	fwrite($cache, $channel . "\001" . $name . "\001" . $date . "\001" . $usersCount . "\n");
+}
+?>