move webparts into assets

This commit is contained in:
Alexandr
2018-01-18 14:24:33 +01:00
parent 4f1ea4de2d
commit 63011f7a53
6 changed files with 15 additions and 8 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
settings.ini
.vscode/*
.vscode/*
assets/*

View File

@ -6,6 +6,7 @@
</head>
<body>
hui
<h1>Rutracker notifyer </h1>
<h3>I will notify you when interesting for you topic will be updated.</h3>
<form action="add.php" method="post">
@ -14,4 +15,4 @@
<input type="submit">
</form>
</body>
</html>
</html>

9
updater.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/python3
# TODO - config file.
import pymysql.cursors
import urllib.request, json
@ -9,18 +9,19 @@ from urllib.parse import urlencode
parser = ConfigParser()
parser.read('settings.ini')
parser.read('/home/ab/repos/tracker_watcher/settings.ini')
mysql_user = parser.get('mysql', 'mysql_user')
mysql_host = parser.get('mysql', 'mysql_host')
mysql_db = parser.get('mysql', 'mysql_db')
mysql_pass = parser.get('mysql', 'mysql_pass')
interval = '1 HOUR'
#interval = '1 MINUTE'
#interval = '1 HOUR'
interval = '20 MINUTE'
# Connect to the database
connection = pymysql.connect(host=mysql_host,
user=mysql_user,
db=mysql_db,
passwd=mysql_pass,
cursorclass=pymysql.cursors.DictCursor)
# If u_date which already stored older than fresh u_date

View File

@ -1,7 +1,11 @@
<?php
$config = parse_ini_file("../settings.ini");
$dbh = new PDO('mysql:host='.$config['mysql_host'].';dbname='.$config['mysql_db'], $config['mysql_user']);
$dbh = new PDO(
'mysql:host='.$config['mysql_host'].';dbname='.$config['mysql_db'],
$config['mysql_user'],
$config['mysql_pass']
);
$request = file_get_contents('php://input');
$request = json_decode( $request, TRUE );
@ -214,4 +218,4 @@ else
register();
}
}
?>
?>