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

1
.gitignore vendored
View File

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

View File

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

9
updater.py Normal file → Executable file
View File

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

View File

@ -1,7 +1,11 @@
<?php <?php
$config = parse_ini_file("../settings.ini"); $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 = file_get_contents('php://input');
$request = json_decode( $request, TRUE ); $request = json_decode( $request, TRUE );