<?php

namespace App\Http\Controllers;

use App\Helpers\FirstParty\DFS\DFSCommon;
use App\Helpers\FirstParty\DFS\DFSOnPage;
use Illuminate\Http\Request;

class TestOnPageController extends Controller
{
    public function listId(Request $request)
    {
        $response = DFSOnPage::listId(7);

        $tasks = DFSCommon::getTasks($response);

        foreach ($tasks as $task) {
            $task_result = DFSCommon::getTaskResult($task);

            dump($task_result);
        }
    }

    public function taskPost(Request $request)
    {
        $response = DFSOnPage::taskPost('dataforseo.com', 1);

        $tasks = DFSCommon::getTasks($response);

        foreach ($tasks as $task) {
            $task_result = DFSCommon::getTaskResult($task);

            dump($task_result);
        }
    }
}
