This commit is contained in:
printfuck 2020-04-20 01:16:44 +02:00
parent 7dd22d74af
commit 4ba097060a
3 changed files with 14 additions and 8 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
__pycache__

12
main.py
View file

@ -13,7 +13,7 @@ from cssselect import HTMLTranslator, SelectorError
import requests as req
from io import StringIO
import web
#import web
DB_HOST = "127.0.0.1"
DB_USER = "dbuser"
@ -172,11 +172,15 @@ def main():
createTableMa(db, "feeds")
if not createTableIm(db, "feed01"):
die()
rt = Periodic(60*60*1, updateFeed, [db, "feed01"])
updateFeed(db,"feed01")
#rt = Periodic(60*60*1, updateFeed, [db, "feed01"])
while True:
time.sleep(5)
if __name__ == "__main__":
main()
class lf:
def __init__(self, db, name):
@ -266,7 +270,7 @@ class lf:
"feeds",self.name,self.url,self.password,
self.username,self.selector,
self.selector_login_user,self.selector_login_pass,
self.selector_login_verify,self.selector_login_url
self.selector_login_verify,self.selector_login_url,
self.selector_login_verify_url)
)
else:
@ -280,7 +284,7 @@ class lf:
self.url,self.password,
self.username,self.selector,
self.selector_login_user,self.selector_login_pass,
self.selector_login_verify,self.selector_login_url
self.selector_login_verify,self.selector_login_url,
self.selector_login_verify_url)
)

9
web.py
View file

@ -7,8 +7,9 @@ from flask import Flask,request
app = Flask(__name__)
def run_flask(host,port)
app.run(host=host, port=port)
def run_flask(host,port):
app = Flask(host=host, port=port)
app.run()
def getFeeds(db):
db = getDb()
@ -21,7 +22,7 @@ def getFeeds(db):
return feeds
@app.route('/')
def list()
def list():
feeds = getFeeds()
a = "<html><body><p>Header</p><br><table><tr><td>Feeds</td></tr>"
for i in feeds:
@ -53,4 +54,4 @@ def configure(feed_name):
<label for="{}">{}</label><br>
<input type="text" value="{}" id="{}">
'''.format(i,i,feed.query_db(i),i)
a += "</form></body></html>
a += "</form></body></html>"