This commit is contained in:
Alexander Popov 2023-06-03 23:49:12 +03:00
parent 834aef432e
commit 4a21130567
Signed by: iiiypuk
GPG Key ID: E47FE0AB36CD5ED6
8 changed files with 93 additions and 80 deletions

View File

@ -74,3 +74,14 @@ indent_size = 4
[~/SublimeText/*.sublime-*]
indent_style = tab
indent_size = 4
[~/Gambas/*]
indent_size = 2
[~/Solar2D/**]
indent_style = unset
indent_size = unset
end_of_line = unset
charset = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

View File

@ -1,26 +1,26 @@
#!/bin/bash
#!/bin/bash
# https://linuxconcept.com/making-a-simple-irc-chat-bot-logger-using-bash-script/
nick="blb$$"
nick="blb$$"
channel=admin
server=iiiypuk.me
config=/tmp/irclog
[ -n "$1" ] && channel=$1
[ -n "$2" ] && server=$2
config="${config}_${channel}"
echo "NICK $nick" > $config
echo "USER $nick +i * :$0" >> $config
echo "JOIN #$channel" >> $config
trap "rm -f $config;exit 0" INT TERM EXIT
tail -f $config | nc $server 6667 | while read MESSAGE
do
case "$MESSAGE" in
PING*) echo "PONG${MESSAGE#PING}" >> $config;; *QUIT*) ;;
*PART*) ;;
*JOIN*) ;;
*NICK*) ;;
*PRIVMSG*) echo "${MESSAGE}" | sed -nr "s/^:([^!]+).*PRIVMSG[^:]+:(.*)/[$(date '+%R')] \1> \2/p" >> $config;;
*) echo "${MESSAGE}";;
esac
config=/tmp/irclog
[ -n "$1" ] && channel=$1
[ -n "$2" ] && server=$2
config="${config}_${channel}"
echo "NICK $nick" > $config
echo "USER $nick +i * :$0" >> $config
echo "JOIN #$channel" >> $config
trap "rm -f $config;exit 0" INT TERM EXIT
tail -f $config | nc $server 6667 | while read MESSAGE
do
case "$MESSAGE" in
PING*) echo "PONG${MESSAGE#PING}" >> $config;; *QUIT*) ;;
*PART*) ;;
*JOIN*) ;;
*NICK*) ;;
*PRIVMSG*) echo "${MESSAGE}" | sed -nr "s/^:([^!]+).*PRIVMSG[^:]+:(.*)/[$(date '+%R')] \1> \2/p" >> $config;;
*) echo "${MESSAGE}";;
esac
done

View File

@ -1,8 +1,8 @@
body{
margin: 0px;
height: 100vh;
background-image: url('../img/landing.jpg');
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
margin: 0px;
height: 100vh;
background-image: url('../img/landing.jpg');
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}

View File

@ -107,22 +107,22 @@
```html
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Заголовок страницы</title>
</head>
<body>
<header class="main-header">
<!— Шапка сайта —>
</header>
<head>
<meta charset="utf-8">
<title>Заголовок страницы</title>
</head>
<body>
<header class="main-header">
<!— Шапка сайта —>
</header>
<main>
<!— Основное содержимое страницы —>
</main>
<main>
<!— Основное содержимое страницы —>
</main>
<footer class="main-footer">
<!— Подвал сайта —>
</footer>
</body>
<footer class="main-footer">
<!— Подвал сайта —>
</footer>
</body>
</html>
```

View File

@ -1,11 +1,13 @@
# Fenom
## IF . ELSEIF . ELSE
```
{if <expression>}
{* ...code... *}
{* ...code... *}
{elseif <expression>}
{* ...code... *}
{* ...code... *}
{else}
{* ...code... *}
{* ...code... *}
{/if}
```

View File

@ -1,18 +1,18 @@
<?php
// gettype(mixed $value): string
$value = 1;
// gettype(mixed $value): string
$value = 1;
// Return Values
// Possible values for the returned string are:
//
// "boolean"
// "integer"
// "double" (for historical reasons "double" is returned in case of a float, and not simply "float")
// "string"
// "array"
// "object"
// "resource"
// "resource (closed)" as of PHP 7.2.0
// "NULL"
// "unknown type"
// Return Values
// Possible values for the returned string are:
//
// "boolean"
// "integer"
// "double" (for historical reasons "double" is returned in case of a float, and not simply "float")
// "string"
// "array"
// "object"
// "resource"
// "resource (closed)" as of PHP 7.2.0
// "NULL"
// "unknown type"
?>

View File

@ -77,21 +77,21 @@
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Johny</td><td>10th</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Johny</td><td>10th</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';

View File

@ -16,14 +16,14 @@ irc.send(str.encode('NICK ' + botnick + '\n'))
irc.send(str.encode('JOIN '+ channel +'\n'))
while True:
text = irc.recv(2040)
print(text)
text = irc.recv(2040)
print(text)
if text.find(str.encode('PING')) != -1:
irc.send(str.encode('PONG ' + str(text.split()[1]) + '\r\n'))
if text.find(str.encode('PING')) != -1:
irc.send(str.encode('PONG ' + str(text.split()[1]) + '\r\n'))
# !time - return current timestamp
if text.find(str.encode('!time')) != -1:
ts = time.time()
irc.send(str.encode('PRIVMSG #admin :{}\r\n'.format(int(ts))))
# !time - return current timestamp
if text.find(str.encode('!time')) != -1:
ts = time.time()
irc.send(str.encode('PRIVMSG #admin :{}\r\n'.format(int(ts))))