Initial commit

This commit is contained in:
Lucas Verney 2018-02-26 20:48:57 +01:00
commit 078ed59c2c
3 changed files with 45 additions and 0 deletions

BIN
.db.py.swp Normal file

Binary file not shown.

12
db.py Normal file
View 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
View 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])