-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
from selenium import webdriver
import time
import telegram
def A():
код парсера
while True:
browser = webdriver.Chrome()
browser.maximize_window()
browser.get('ссылка')
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[5]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[5]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[4]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[4]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[3]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[3]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
try:
BOT_TOKEN = 'токен'
number2 = browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[6]/div/div[1]/div[1]/div').text
SS = number2.split()
if SS[0] == '0' and SS[1] == '0':
browser.find_element_by_xpath('//*[@id="games_content"]/div/div[1]/div/div/div[6]/div/div[1]/div[1]/a').click()
time.sleep(5)
A()
except Exception:
pass
browser.close()
time.sleep(15)
Вопросик с хабра)
Safronov_alexei,
02 Июля 2020
-
+1
- 1
- 2
https://infostart.ru/public/72175/
1C.Net:Предприятие + DirectX = 3D-графика на формах 1С:Предприятие
Зачем? Зачем?
j123123,
04 Июня 2020
-
+3
- 1
Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.
МОЭК запустила дополнительный информационный сервис для москвичей о сроках отключения горячей воды
https://online.moek.ru
real_escape_string,
03 Июня 2020
-
+1
- 1
- 2
- 3
- 4
- 5
Если НЕ Объект.Валютный Тогда
Объект.ПересчитыватьВалютнуюСумму=Ложь;
Иначе
Объект.ПересчитыватьВалютнуюСумму=Истина;
КонецЕсли;
Типовая УХ
aumsej,
29 Мая 2020
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
#include <iostream>
#include <chrono>
#include <thread>
#include <fstream>
#include <string>
using namespace std;
float Cheking = 0;
void read_file()
{
string line;
ifstream file("text.bin");
if (file)
{
while (getline(file, line))
{
file >> Cheking;
}
file.close();
}
}
void write_file()
{
ofstream myfile("text.bin");
if (myfile.is_open())
{
myfile << "\n";
myfile << Cheking << "\n";
myfile.close();
}
else
{
cout << "Unable to open file";
myfile.close();
}
}
int main()
{
using namespace chrono;
using namespace this_thread;
setlocale(LC_ALL, "ukr");
read_file();
cout << "Число: " << Cheking << "\t\t";
cout << endl;
if (Cheking == 0)
{
cin >> Cheking;
}
write_file();
sleep_for(milliseconds(1000));
return 0;
}
Простой гавнокод для храненния переменных в файле.
vova09082000,
06 Мая 2020
-
+5
- 1
- 2
Скоро Новый год. Високосный год Крысы.
А ты уже загадал желание? ^_
https://www.youtube.com/watch?v=RpDfkJD4PYU
Wyrap_nJll-oM_qpaupu,
24 Декабря 2019
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
procedure TForm1.Button1Click(Sender: TObject);
var
RequestBody,SResponseBody: TStringStream;
ResponseBody: string;
begin
try
RequestBody := TStringStream.Create('{"login":"user","password":"pass999"}') ;
httpconn.HandleRedirects:=TRUE;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvSSLv23;
//httpconn.Host:='api.owencloud.ru';
httpconn.Request.Accept:='application/xml';
httpconn.Request.ContentLength:=68;
httpconn.Request.ContentType:='application/x-www-form-urlencoded';
ResponseBody:=httpconn.Post('https://api.owencloud.ru/v1/auth/open', RequestBody);
SResponseBody:=TStringStream.Create(httpconn.Post('https://api.owencloud.ru/v1/auth/open', RequestBody));
memo1.Text:=utf8toansi(ResponseBody);
xmldocument1.LoadFromStream(SResponseBody);
finally
RequestBody.Free;
SResponseBody.Free;
end;
end;
Передача в мемо волшебна, а в xml так вообще виртуозна
untitled_001,
30 Ноября 2019
-
+1
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
.server-config
.component
.title(translate) protsessor
.value(ng-if="!server.custom")
| {{ server.cpu || '—' }}
.value(ng-if="server.custom")
span(ng-if="server.custom.cpu && server.custom.cpu.length && server.custom.cpu[0].count > 1")
| {{ server.custom.cpu[0].count + ' x ' }}
span(ng-if="server.custom.cpu && server.custom.cpu.length")
| {{ server.custom.cpu[0].name }}
span(ng-if="!server.custom.cpu || !server.custom.cpu.length")
| —
.component
.title(translate) pamyat
.value(ng-if="!server.custom")
| {{ server.memory || '—' }}
.value(ng-if="server.custom")
span(ng-if="server.custom.ram && server.custom.ram.length")
span(ng-if="server.custom.ram[0].count > 1")
| {{ +server.custom.ram[0].name.split(' ')[0].replace('GB', '') * server.custom.ram[0].count + ' GB — ' }}
span(ng-if="server.custom.ram[0].count > 1")
| {{ server.custom.ram[0].count + ' x ' }}
span
| {{ server.custom.ram[0].name }}
span(ng-if="!server.custom.ram || !server.custom.ram.length")
| —
.component
.title(translate) disk
.value(ng-if="!server.custom")
| {{ server.hdd || '—' }}
.value(ng-if="server.custom.disk && server.custom.disk.length")
.line(ng-repeat="hdd in server.custom.disk")
span(ng-if="hdd.count > 1") {{ hdd.count + ' x ' }}
span {{ hdd.name }}
.value(ng-if="server.custom && (!server.custom.disk || !server.custom.disk.length)")
| —
.component(ng-if="server.custom")
.title(translate) Platform
.value(ng-if="server.custom.case && server.custom.case.length")
| {{ server.custom.case[0].name }}
.value(ng-if="server.custom && (!server.custom.case || !server.custom.case.length)")
| —
.component(ng-if="server.custom")
.title(translate) Motherboard
.value(ng-if="server.custom.motherboard && server.custom.motherboard.length")
| {{ server.custom.motherboard[0].name }}
.value(ng-if="server.custom && (!server.custom.motherboard || !server.custom.motherboard.length)")
| —
.component(ng-if="server.custom.pcie && server.custom.pcie.length")
.title(translate) pcie
.value
.line(ng-repeat="pcie in server.custom.pcie")
span(ng-if="pcie.count > 1") {{ pcie.count + ' x ' }}
span {{ pcie.name }}
Код написан на Pug, представляет из себя фрагмент шаблона AngularJS, предназначенный для отображения конфигурации сервера. Данный код, через копирование-вставку, был заботливо размещен в нескольких файлах, иногда претерпевая незначительные изменения. Здесь публикую отчищенный от всего лишнего и сильно отформатированный вариант, дабы проще было насладиться полетом фантазии автора, в исходном виде весь этот код - одно сплошное месиво.
maksim_ovcharik,
21 Ноября 2019
-
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
#!/usr/bin/perl -w
use strict;
use warnings;
use v5.22;
use Encode qw(encode decode);
binmode $_, ':utf8' for qw(STDOUT STDIN);
my $c = 'KOI8-R';
print decode $c, join '', map {chr (ord() & 0x7F)} split '', encode $c, $_ while (<>);
данный програмный продукт переводит русские буквы в забавные волапюки.
Пользуйтесь на здоровье!
$ echo "милости прошу к нашему шалашу" | ./koi.pl
mILOSTI PRO[U K NA[EMU [ALA[U
neTyx_npoTKHyTbIu,
16 Ноября 2019
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
DBconfig.php
<?
function sql_connect($mysqlhost,$mysqluser,$mysqlpass,$mysqldb){
$sql_conn=mysql_connect($mysqlhost,$mysqluser,$mysqlpass) or die("mysql_query error: " .mysql_error());
mysql_select_db($mysqldb);
}
function sql_execute($query, $get_counter = false)
{
static $sqlquerycounter = 0;
if(isset($_GET['_dbg']) && isset($_GET['_sql'])){pr('['.$sqlquerycounter.'] '.$query);}
if(!$get_counter)
{
if (!$query = mysql_query($query)) {
trigger_error('MySQL Error: '.mysql_error());
}
$sqlquerycounter++;
return $query;
}
else {return $sqlquerycounter;}
}
function sql_close(){
mysql_close($sql_conn);
}
?>
file.php
sql_connect($_CONFIG["mysqlhost"], $_CONFIG["mysqluser"], $_CONFIG["mysqlpass"], $_CONFIG["mysqldb"]);
$sql = sql_execute("SET NAMES UTF8");
$sql = sql_execute("SELECT * FROM publications WHERE id='$_GET[id]' LIMIT 0,1");
$res = mysql_fetch_array($sql);
phpBidlokoder2,
11 Ноября 2019