Initial commit
This commit is contained in:
commit
078ed59c2c
BIN
.db.py.swp
Normal file
BIN
.db.py.swp
Normal file
Binary file not shown.
12
db.py
Normal file
12
db.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from peewee import *
|
||||||
|
|
||||||
|
db = SqliteDatabase('people.db')
|
||||||
|
|
||||||
|
|
||||||
|
class Person(Model):
|
||||||
|
name = CharField()
|
||||||
|
birthday = DateField()
|
||||||
|
is_relative = BooleanField()
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
database = db
|
33
main.py
Normal file
33
main.py
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from weboob.core.ouiboube import WebNip
|
||||||
|
from weboob.tools.json import WeboobEncoder
|
||||||
|
|
||||||
|
BACKENDS = ['750g', 'allrecipes', 'cuisineaz', 'marmiton', 'supertoinette']
|
||||||
|
|
||||||
|
|
||||||
|
def __main__(url, modules_path=None):
|
||||||
|
webnip = WebNip(modules_path=modules_path)
|
||||||
|
|
||||||
|
backends = [
|
||||||
|
webnip.load_backend(
|
||||||
|
module,
|
||||||
|
module,
|
||||||
|
params={}
|
||||||
|
)
|
||||||
|
for module in BACKENDS
|
||||||
|
]
|
||||||
|
|
||||||
|
for backend in backends:
|
||||||
|
browser = backend.browser
|
||||||
|
if url.startswith(browser.BASEURL):
|
||||||
|
browser.location(url)
|
||||||
|
recipe = browser.page.get_recipe()
|
||||||
|
print(json.dumps(recipe, cls=WeboobEncoder))
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
__main__(sys.argv[1])
|
Loading…
Reference in New Issue
Block a user