PHP code example of donut-org / donut

1. Go to this page and download the library: Download donut-org/donut library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

donut-org / donut example snippets

 php


adapter = new Donut\Adapters\DibiSqliteAdapter(__DIR__ . '/app/db.sq3');
$processor = new Donut\Processor($adapter, function () {
	sleep(5 * 60); // 5 minutes
});


// prepare tasks
$facebookQueue = $processor->createQueue('facebook-queue')
	->facebookPublishFacebookPost($accountId, $appId, $appSecret, $userAccessToken);

$processor->createQueue('blogposts-queue')
	->rssFeedFetchNewItems('https://example.com/feed/rss', '1h')
	->rssFeedConvertItemToFacebookPost('NEW BLOGPOST! %TITLE%', $facebookQueue);


// RUN!
$processor->run(100); // number of repeats