A Cookidoo Shopping List Scraper and Parser for better results. It can unify and merge all ingredients by different rule sets.
移至檔案
Florian Brinker 4be68a4915 Add example
2021-04-20 00:28:43 +02:00
src First version 2021-04-20 00:19:48 +02:00
.gitignore First version 2021-04-20 00:19:48 +02:00
composer.json First version 2021-04-20 00:19:48 +02:00
composer.lock First version 2021-04-20 00:19:48 +02:00
config.sample.php First version 2021-04-20 00:19:48 +02:00
LICENSE Initial commit 2021-04-19 22:17:36 +00:00
README.md Add example 2021-04-20 00:28:43 +02:00

cookidoo-shopping-advanced

A Cookidoo Shopping List Scraper and Parser for better results. It can unify and merge all ingredients by different rule sets.

Example

// use ...
$config = require('config.php');

$cookidooScraper = new CookidooScraper();
$cookidooScraper->login(
    $config['account']['username'], 
    $config['account']['password']
);

$list = $cookidooScraper->getShopptingList();

$ruleApplicator = new RuleApplicator();
$ruleApplicator->applyRules(
    $list, 
    [ 
        new Rules\Omit(),
        new Rules\Simplify(),
        new Rules\MergeSame(),
    ]
);

$categorizedList = $list->getByCategory();
// ...

Caching

You can cache the shopping list as a json file:

file_put_contents('./list.json', $list->toJson());

$list = ShoppingList::fromJson(file_get_contents('./list.json'));