slitaz-forge rev 399
Remove all files in irc
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Jan 14 16:01:16 2014 +0100 (2014-01-14) |
parents | e82b2efe2e82 |
children | 2886f4c59d8f |
files | irc/README irc/src/config.ini irc/src/html/favicon.ico irc/src/html/index.php irc/src/html/logo.png irc/src/html/style.css irc/src/org/jibble/logbot/LogBot.java irc/src/org/jibble/logbot/LogBotMain.java irc/src/org/jibble/logbot/compile.sh |
line diff
1.1 --- a/irc/README Mon Jan 13 18:52:02 2014 +0000 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,1 +0,0 @@ 1.4 -Source for irc.slitaz.org 1.5 \ No newline at end of file
2.1 --- a/irc/src/config.ini Mon Jan 13 18:52:02 2014 +0000 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,9 +0,0 @@ 2.4 -# 2.5 -# Config file for the Java IRC LogBot 2.6 -# http://www.jibble.org/logbot/ 2.7 -# 2.8 -Nick = TazLog 2.9 -Server = irc.freenode.org 2.10 -Channel = #slitaz 2.11 -JoinMessage = This channel is being logged @ http://irc.slitaz.org/ 2.12 -OutputDir = /home/slitaz/public_html
3.1 Binary file irc/src/html/favicon.ico has changed
4.1 --- a/irc/src/html/index.php Mon Jan 13 18:52:02 2014 +0000 4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 4.3 @@ -1,106 +0,0 @@ 4.4 -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 4.5 -<?php 4.6 - include("config.inc.php"); 4.7 -?> 4.8 -<html><head> 4.9 -<title>SliTaz IRC Logs</title> 4.10 -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 4.11 -<meta name="description" content="SliTaz IRC Logs" /> 4.12 -<meta name="keywords" content="SliTaz IRC Logs" /> 4.13 -<link rel="stylesheet" href="style.css" type="text/css" /> 4.14 -</head> 4.15 -<body> 4.16 -<?php $now = date('Y-m-d'); ?> 4.17 -<!-- Header --> 4.18 -<div id="header"> 4.19 - <div id="logo"></div> 4.20 - <div id="network"> 4.21 - <a href="http://www.slitaz.org/">Home</a> 4.22 - <a href="http://scn.slitaz.org/">Community</a> 4.23 - <a href="http://webchat.freenode.net/?channels=#slitaz">IRC</a> 4.24 - <a href="http://doc.slitaz.org/">Doc</a> 4.25 - <a href="http://forum.slitaz.org/">Forum</a> 4.26 - <a href="http://slitaz.pro/">Pro</a> 4.27 - <a href="http://shop.slitaz.org/">Shop</a> 4.28 - <a href="http://bugs.slitaz.org/">Bugs</a> 4.29 - <a href="http://hg.slitaz.org/?sort=lastchange">Hg</a> 4.30 - </div> 4.31 - <h1><a href="./">SliTaz IRC Logs</a></h1> 4.32 -</div> 4.33 -<?php 4.34 - $date = $_GET['date']; 4.35 - if (is_null($date)) { 4.36 - $date = $now; 4.37 - } 4.38 - if (isset($date) && preg_match("/^\d\d\d\d-\d\d-\d\d$/", $date)) { 4.39 -?> 4.40 -<div id="contentbox"> 4.41 - <h2>Log for <?php echo($date); ?></h2> 4.42 - <p>Timestamps are GMT-6</p> 4.43 - <p><a href="./index"><< Go to Index</a></p> 4.44 -</div> 4.45 -<div id="content"> 4.46 -<?php 4.47 - readfile($date . ".log"); 4.48 -?> 4.49 -</div> 4.50 -<?php 4.51 - } 4.52 - elseif (isset($date) && preg_match("/^index$/", $date)) { 4.53 - $dir = opendir("."); 4.54 - while (false !== ($file = readdir($dir))) { 4.55 - if (strpos($file, ".log") == 10) { 4.56 - $filearray[] = $file; 4.57 - } 4.58 - } 4.59 - closedir($dir); 4.60 - 4.61 - rsort($filearray); 4.62 -?> 4.63 -<div id="contentbox"> 4.64 - <div style="text-align: justify; width: 48%; padding: 20px 10px 0pt 0pt;"> 4.65 - These are the logs from the #slitaz support channel on freenode.<br /> 4.66 - The main purpose of these is to provide records of meetings and<br /> 4.67 - dicussions we have on IRC - not that pankso is around much...<br /><br /> 4.68 - Please click on the date of the log you wish to view:<br /> 4.69 - </div> 4.70 -</div> 4.71 -<div id="content"> 4.72 - <ul> 4.73 -<?php 4.74 - foreach ($filearray as $file) { 4.75 - $file = substr($file, 0, 10); 4.76 -?> 4.77 - <li><a href="<?php echo($file); ?>"><?php echo($file); ?></a></li> 4.78 -<?php 4.79 - } 4.80 -?> 4.81 - </ul> 4.82 -</div> 4.83 -<?php 4.84 - } 4.85 -?> 4.86 -<div id="footer"> 4.87 - <p> 4.88 - Network: 4.89 - <a href="http://www.slitaz.org/">Main Site</a> 4.90 - <a href="http://scn.slitaz.org/">Community</a> 4.91 - <a href="http://doc.slitaz.org/">Doc</a> 4.92 - <a href="http://forum.slitaz.org/">Forum</a> 4.93 - <a href="http://pkgs.slitaz.org/">Packages</a> 4.94 - <a href="http://bugs.slitaz.org">Bugs</a> 4.95 - <a href="http://hg.slitaz.org/">Hg</a> 4.96 - <br> 4.97 - SliTaz @ 4.98 - <a href="http://twitter.com/slitaz">Twitter</a> 4.99 - <a href="http://www.facebook.com/slitaz">Facebook</a> 4.100 - <a href="http://distrowatch.com/slitaz">Distrowatch</a> 4.101 - <a href="http://en.wikipedia.org/wiki/SliTaz">Wikipedia</a> 4.102 - <a href="http://flattr.com/profile/slitaz">Flattr</a> 4.103 - </p> 4.104 - <p> 4.105 - These logs were automatically created by <b><?php echo($nick); ?></b> 4.106 - using <a href="http://www.jibble.org/logbot/">LogBot</a> 4.107 - </p> 4.108 -<div/> 4.109 -</body></html>
5.1 Binary file irc/src/html/logo.png has changed
6.1 --- a/irc/src/html/style.css Mon Jan 13 18:52:02 2014 +0000 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,104 +0,0 @@ 6.4 -body { 6.5 - margin: 0; 6.6 - padding: 0; 6.7 - background: #f1f1f1; 6.8 - font: 13px sans-serif, vernada, arial; 6.9 -} 6.10 - 6.11 -.irc-date { color: gray; } 6.12 -.irc-green { color: green; } 6.13 -.irc-white { color: black; } 6.14 -.irc-orange { color: #E0681E; } 6.15 -.irc-yellow { color: #6D1670; } 6.16 -.irc-grey { color: gray; } 6.17 -.irc-red { color: red; } 6.18 -a {text-decoration: none; color: #215090; } 6.19 -a:hover {text-decoration: none; color: blue; } 6.20 -img { border: 0pt none; vertical-align: middle; } 6.21 - 6.22 -/* Header */ 6.23 -#header { 6.24 - margin: 0; 6.25 - width: 100%; 6.26 - height: 40px; 6.27 - position: relative; 6.28 - background: #351a0a; 6.29 -} 6.30 -#header h1 { 6.31 - margin: 0; 6.32 - padding: 2px 0 0 42px; 6.33 - width: 250px; 6.34 - clear: none; 6.35 -} 6.36 -#header h1 a { 6.37 - color: white; 6.38 - text-decoration: none; 6.39 - font-size: 20px; 6.40 - font-style: italic; 6.41 -} 6.42 -#header h1 a:hover, #network a:hover { color: #cfcfcf; } 6.43 -#header p { margin-bottom: 0; } 6.44 -#header h1 a { color: #fff; text-decoration: none; } 6.45 - 6.46 -/* Logo */ 6.47 -#logo { 6.48 - background: url(logo.png) no-repeat left; 6.49 - position: absolute; 6.50 - float: left; 6.51 - left: 0px; 6.52 - top: 0px; 6.53 - width: 40px; 6.54 - height: 40px; 6.55 -} 6.56 - 6.57 -/* SliTaz Network */ 6.58 -#network { 6.59 - float: right; 6.60 - padding: 10px 5px 0; 6.61 - font-size: 12px; 6.62 -} 6.63 -#network a { 6.64 - padding: 0 6px; 6.65 - color: #fff; 6.66 - font-weight: bold; 6.67 - text-decoration: none; 6.68 -} 6.69 - 6.70 -#content { 6.71 - padding-top: 10px; 6.72 - padding-left: 80px; 6.73 - padding-bottom: 10px; 6.74 - padding-right: 20px; 6.75 - font-size: 13px; 6.76 - background-color: #fff; 6.77 - color: #000; 6.78 -} 6.79 - 6.80 -#contentbox { 6.81 - padding-left: 80px; 6.82 - padding-top: 1px; 6.83 - padding-bottom: 1px; 6.84 - font-size: 13px; 6.85 - background: #d66018; 6.86 - color: #333; 6.87 - min-height: 120px; 6.88 -} 6.89 -#contentbox a { 6.90 - color: #fff; 6.91 - text-decoration: none; 6.92 -} 6.93 -#contentbox a:hover { 6.94 - text-decoration: underline; 6.95 -} 6.96 - 6.97 -#footer { 6.98 - background: #f1f1f1; 6.99 - text-align: center; 6.100 - border-top: 1px solid #ddd; 6.101 - padding: 20px; 6.102 - color: #666; 6.103 - margin: 0; 6.104 - clear: both; 6.105 -} 6.106 -#footer a { color: #666; padding: 0 2px; text-decoration: underline; } 6.107 -#footer a:hover { text-decoration: none; }
7.1 --- a/irc/src/org/jibble/logbot/LogBot.java Mon Jan 13 18:52:02 2014 +0000 7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 7.3 @@ -1,165 +0,0 @@ 7.4 -package org.jibble.logbot; 7.5 - 7.6 -import java.util.*; 7.7 -import java.util.regex.*; 7.8 -import java.io.*; 7.9 -import java.text.SimpleDateFormat; 7.10 -import org.jibble.pircbot.*; 7.11 - 7.12 -public class LogBot extends PircBot { 7.13 - 7.14 - private static final Pattern urlPattern = Pattern.compile("(?i:\\b((http|https|ftp|irc)://[^\\s]+))"); 7.15 - private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); 7.16 - private static final SimpleDateFormat TIME_FORMAT = new SimpleDateFormat("HH:mm"); 7.17 - 7.18 - public static final String GREEN = "irc-green"; 7.19 - public static final String WHITE = "irc-white"; 7.20 - public static final String ORANGE = "irc-orange"; 7.21 - public static final String YELLOW = "irc-yellow"; 7.22 - public static final String GREY = "irc-grey"; 7.23 - public static final String RED = "irc-red"; 7.24 - 7.25 - public LogBot(String name, File outDir, String joinMessage) { 7.26 - setName(name); 7.27 - setVerbose(true); 7.28 - this.outDir = outDir; 7.29 - this.joinMessage = joinMessage; 7.30 - } 7.31 - 7.32 - public void append(String color, String line) { 7.33 - line = Colors.removeFormattingAndColors(line); 7.34 - 7.35 - line = line.replaceAll("&", "&"); 7.36 - line = line.replaceAll("<", "<"); 7.37 - line = line.replaceAll(">", ">"); 7.38 - 7.39 - Matcher matcher = urlPattern.matcher(line); 7.40 - line = matcher.replaceAll("<a href=\"$1\">$1</a>"); 7.41 - 7.42 - 7.43 - try { 7.44 - Date now = new Date(); 7.45 - String date = DATE_FORMAT.format(now); 7.46 - String time = TIME_FORMAT.format(now); 7.47 - File file = new File(outDir, date + ".log"); 7.48 - BufferedWriter writer = new BufferedWriter(new FileWriter(file, true)); 7.49 - String entry = "<span class=\"irc-date\">(" + time + ")</span> <span class=\"" + color + "\">" + line + "</span><br />"; 7.50 - writer.write(entry); 7.51 - writer.newLine(); 7.52 - writer.flush(); 7.53 - writer.close(); 7.54 - } 7.55 - catch (IOException e) { 7.56 - System.out.println("Could not write to log: " + e); 7.57 - } 7.58 - } 7.59 - 7.60 - public void onAction(String sender, String login, String hostname, String target, String action) { 7.61 - append(YELLOW, "* " + sender + " " + action); 7.62 - } 7.63 - 7.64 - public void onJoin(String channel, String sender, String login, String hostname) { 7.65 - append(GREEN, "*** " + sender + " (" + login + "@" + hostname + ") has joined " + channel); 7.66 - // if (sender.equals(getNick())) { 7.67 - // sendNotice(channel, joinMessage); 7.68 - // } else { 7.69 - // sendNotice(sender, joinMessage); 7.70 - // } 7.71 - } 7.72 - 7.73 - public void onMessage(String channel, String sender, String login, String hostname, String message) { 7.74 - append(WHITE, "[" + sender + "] " + message); 7.75 - 7.76 - message = message.toLowerCase(); 7.77 - if (message.startsWith(getNick().toLowerCase()) && message.indexOf("help") > 0) { 7.78 - sendMessage(channel, joinMessage); 7.79 - } 7.80 - } 7.81 - 7.82 - public void onMode(String channel, String sourceNick, String sourceLogin, String sourceHostname, String mode) { 7.83 - append(ORANGE, "*** " + sourceNick + " sets mode " + mode); 7.84 - } 7.85 - 7.86 - public void onNickChange(String oldNick, String login, String hostname, String newNick) { 7.87 - append(ORANGE, "*** " + oldNick + " is now known as " + newNick); 7.88 - } 7.89 - 7.90 - public void onNotice(String sourceNick, String sourceLogin, String sourceHostname, String target, String notice) { 7.91 - // append(ORANGE, "-" + sourceNick + "- " + notice); 7.92 - } 7.93 - 7.94 - public void onPart(String channel, String sender, String login, String hostname) { 7.95 - append(GREY, "*** " + sender + " (" + login + "@" + hostname + ") has left " + channel); 7.96 - } 7.97 - 7.98 - public void onPing(String sourceNick, String sourceLogin, String sourceHostname, String target, String pingValue) { 7.99 - // append(RED, "[" + sourceNick + " PING]"); 7.100 - } 7.101 - 7.102 - public void onPrivateMessage(String sender, String login, String hostname, String message) { 7.103 - // append(WHITE, "<- *" + sender + "* " + message); 7.104 - } 7.105 - 7.106 - public void onQuit(String sourceNick, String sourceLogin, String sourceHostname, String reason) { 7.107 - append(RED, "*** " + sourceNick + " (" + sourceLogin + "@" + sourceHostname + ") has quit (" + reason + ")"); 7.108 - } 7.109 - 7.110 - public void onTime(String sourceNick, String sourceLogin, String sourceHostname, String target) { 7.111 - // append(RED, "[" + sourceNick + " TIME]"); 7.112 - } 7.113 - 7.114 - public void onTopic(String channel, String topic, String setBy, long date, boolean changed) { 7.115 - if (changed) { 7.116 - append(GREEN, "*** " + setBy + " changes topic to '" + topic + "'"); 7.117 - } 7.118 - else { 7.119 - append(GREEN, "*** Topic is '" + topic + "'"); 7.120 - append(GREEN, "*** Set by " + setBy + " on " + new Date(date)); 7.121 - } 7.122 - } 7.123 - 7.124 - public void onVersion(String sourceNick, String sourceLogin, String sourceHostname, String target) { 7.125 - // append(RED, "[" + sourceNick + " VERSION]"); 7.126 - } 7.127 - 7.128 - public void onKick(String channel, String kickerNick, String kickerLogin, String kickerHostname, String recipientNick, String reason) { 7.129 - append(GREY, "*** " + recipientNick + " was kicked from " + channel + " by " + kickerNick); 7.130 - if (recipientNick.equalsIgnoreCase(getNick())) { 7.131 - joinChannel(channel); 7.132 - } 7.133 - } 7.134 - 7.135 - public void onDisconnect() { 7.136 - append(RED, "*** Disconnected."); 7.137 - while (!isConnected()) { 7.138 - try { 7.139 - reconnect(); 7.140 - } 7.141 - catch (Exception e) { 7.142 - try { 7.143 - Thread.sleep(10000); 7.144 - } 7.145 - catch (Exception anye) { 7.146 - // Do nothing. 7.147 - } 7.148 - } 7.149 - } 7.150 - } 7.151 - 7.152 - public static void copy(File source, File target) throws IOException { 7.153 - BufferedInputStream input = new BufferedInputStream(new FileInputStream(source)); 7.154 - BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(target)); 7.155 - int bytesRead = 0; 7.156 - byte[] buffer = new byte[1024]; 7.157 - while ((bytesRead = input.read(buffer, 0, buffer.length)) != -1) { 7.158 - output.write(buffer, 0, bytesRead); 7.159 - } 7.160 - output.flush(); 7.161 - output.close(); 7.162 - input.close(); 7.163 - } 7.164 - 7.165 - private File outDir; 7.166 - private String joinMessage; 7.167 - 7.168 -}
8.1 --- a/irc/src/org/jibble/logbot/LogBotMain.java Mon Jan 13 18:52:02 2014 +0000 8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 8.3 @@ -1,48 +0,0 @@ 8.4 -package org.jibble.logbot; 8.5 - 8.6 -import java.io.*; 8.7 -import java.util.*; 8.8 - 8.9 -public class LogBotMain { 8.10 - 8.11 - public static void main(String[] args) throws Exception { 8.12 - 8.13 - Properties p = new Properties(); 8.14 - p.load(new FileInputStream(new File("./config.ini"))); 8.15 - 8.16 - String server = p.getProperty("Server", "localhost"); 8.17 - String channel = p.getProperty("Channel", "#test"); 8.18 - String nick = p.getProperty("Nick", "LogBot"); 8.19 - String joinMessage = p.getProperty("JoinMessage", "This channel is logged."); 8.20 - 8.21 - File outDir = new File(p.getProperty("OutputDir", "./output/")); 8.22 - outDir.mkdirs(); 8.23 - if (!outDir.isDirectory()) { 8.24 - System.out.println("Cannot make output directory (" + outDir + ")"); 8.25 - System.exit(1); 8.26 - } 8.27 - 8.28 - LogBot.copy(new File("html/style.css"), new File(outDir, "style.css")); 8.29 - LogBot.copy(new File("html/logo.png"), new File(outDir, "logo.png")); 8.30 - LogBot.copy(new File("html/favicon.ico"), new File(outDir, "favicon.ico")); 8.31 - LogBot.copy(new File("html/index.php"), new File(outDir, "index.php")); 8.32 - 8.33 - BufferedWriter writer = new BufferedWriter(new FileWriter(new File(outDir, "config.inc.php"))); 8.34 - writer.write("<?php"); 8.35 - writer.newLine(); 8.36 - writer.write(" $server = \"" + server + "\";"); 8.37 - writer.newLine(); 8.38 - writer.write(" $channel = \"" + channel + "\";"); 8.39 - writer.newLine(); 8.40 - writer.write(" $nick = \"" + nick + "\";"); 8.41 - writer.newLine(); 8.42 - writer.write("?>"); 8.43 - writer.flush(); 8.44 - writer.close(); 8.45 - 8.46 - LogBot bot = new LogBot(nick, outDir, joinMessage); 8.47 - bot.connect(server); 8.48 - bot.joinChannel(channel); 8.49 - } 8.50 - 8.51 -}