Gets Showtime Infos from a div.

@param Crawler $resultDiv
@return ShowtimeInfo
5773
private function parseShowtimeInfo(Crawler $resultDiv)
    {
        $showtimeSpans = $resultDiv->filter('.times')->first();

        return $this->parseShowtime($showtimeSpans);
    }
1346483
public function afterExecute(
        \Magento\UrlRewrite\Controller\Adminhtml\Url\Rewrite\Save $subject,
        $result
    ) {
        $productId = (int)$this->request->getParam('product', 0);
        if ($productId) {
            $this->catalogResource->setModified([$productId]);
        }
        return $result;
    }
183205
public function getListeners($resultType = self::FULL_RESULT)
    {
        $listeners = [];

        foreach ($this->getEventDispatcher()->getListeners(CronEvent::NAME) as $listener) {
            $listenerClass = get_class($listener[0]);

            if (!$listener[0] instanceof CronEventListenerInterface) {
                $this->getLogger()->addError(sprintf('%s without %s', $listenerClass, CronEventListenerInterface::class));

                continue;
            }

            if (self::FLAT_RESULT === $resultType) {
                $listeners[] = $listenerClass;

                continue;
            }

            $type = $listener[0]::getRepeatedType();
            if (false === isset($listeners[$type])) {
                $listeners[$type] = [];
            }

            $listeners[$type][] = $listenerClass;
        }

        return $listeners;
    }
907990
public function showTime()
    {
        // calculate duration of indexing process
        $endMicrotime = microtime(true);
        $duration = ceil(($endMicrotime - $this->startMicrotime) * 1000);

        // show sec or ms?
        if ($duration > 1000) {
            $duration /= 1000;
            $duration = intval($duration);
            return '<p><i>Indexing process for "'
            . $this->indexerConfig['title']
            . '" took '
            . $duration
            . ' s.</i> </p>'
            . "\n\n";
        } else {
            return '<p><i>Indexing process for "'
            . $this->indexerConfig['title']
            . '" took '
            . $duration
            . ' ms.</i> </p>'
            . "\n\n";
        }
    }
390034
protected function extractMetaInfo(DomCrawler $crawler, $url)
    {
        /*@var $currentLink Link */
        $currentLink = $this->links[$url];
        $currentLink->setMetaInfo('title', '');
        $currentLink->setMetaInfo('metaKeywords', '');
        $currentLink->setMetaInfo('metaDescription', '');        
        
        $currentLink->setMetaInfo('title',trim(strip_tags($crawler->filter('title')->html())));
        
        $crawler->filterXPath('//meta[@name="description"]')->each(function (DomCrawler $node) use (&$currentLink) {
            $currentLink->setMetaInfo('metaDescription', strip_tags($node->attr('content')));
        });
        $crawler->filterXPath('//meta[@name="keywords"]')->each(function (DomCrawler $node) use (&$currentLink) {
            $currentLink->setMetaInfo('metaKeywords',trim($node->attr('content')));
        });
        $crawler->filterXPath('//link[@rel="canonical"]')->each(function(DomCrawler $node) use (&$currentLink){
            $currentLink->setMetaInfo('canonicalLink',trim($node->attr('href')));
        });

        $h1Count = $crawler->filter('h1')->count();
        $currentLink->setMetaInfo('h1Count',$h1Count);
        $currentLink->setMetaInfo('h1Contents', array());
        if ($h1Count > 0) {
            $crawler->filter('h1')->each(function (DomCrawler $node, $i) use ($currentLink) {
                $currentLink->addMetaInfo('h1Contents',trim($node->text()));
            });
        }        
        
        $h2Count = $crawler->filter('h2')->count();
        $currentLink->setMetaInfo('h2Count',$h2Count);
        $currentLink->setMetaInfo('h2Contents', array());
        if ($h2Count > 0) {
            $crawler->filter('h2')->each(function (DomCrawler $node, $i) use ($currentLink) {
                $currentLink->addMetaInfo('h2Contents',trim($node->text()));
            });
        }        
    }
522325
protected function getResults($domain)
    {
        if (! Cache::has('eyewitness_ssl_job_id_'.$domain)) {
            return null;
        }

        $result = $this->eye->api()->sslResult(Cache::pull('eyewitness_ssl_job_id_'.$domain));

        if (isset($result['error'])) {
            return $this->eye->logger()->error('SSL API result error', $result['error'], $domain);
        }

        return $result;
    }
968779
public function setWhoisInfo($result)
    {
        $info = array(
            'server' => $this->query['server'],
        );

        if (!empty($this->query['args'])) {
            $info['args'] = $this->query['args'];
        } else {
            $info['args'] = $this->query['query'];
        }

        if (!empty($this->query['server_port'])) {
            $info['port'] = $this->query['server_port'];
        } else {
            $info['port'] = 43;
        }

        if (isset($result['regyinfo']['whois'])) {
            unset($result['regyinfo']['whois']);
        }

        if (isset($result['regyinfo']['rwhois'])) {
            unset($result['regyinfo']['rwhois']);
        }

        $result['regyinfo']['servers'][] = $info;

        return $result;
    }
275559
function crawlScripts(result, $, endCallback) {

    if (! result.scripts) {
      return endCallback();
    }

    log.debug({"url" : result.url, "step" : "analyzeHTML", "message" : "CrawlScripts"});

    async.each($('script'), function(script, callback) {
        crawlScript($, result, script, callback);
    }, endCallback);
}
489005
public static function _getRow($result = NULL, $useExceptions = _DbConfig::USE_EXCEPTIONS) {
        if (!self::_isConnected()) {
            self::_createConnection();
        }
        return self::$_db->getRow($result, $useExceptions);
    }
302850
public function deepWhois($query, $result)
    {

        if (!isset($result['regyinfo']['whois'])) {
            return $result;
        }

        $this->query['server'] = $wserver = $result['regyinfo']['whois'];
        unset($result['regyinfo']['whois']);
        $subresult = $this->getRawData($query);

        if (!empty($subresult)) {
            $result = $this->setWhoisInfo($result);
            $result['rawdata'] = $subresult;

            if (isset($this->WHOIS_GTLD_HANDLER[$wserver])) {
                $this->query['handler'] = $this->WHOIS_GTLD_HANDLER[$wserver];
            } else {
                $parts = explode('.', $wserver);
                $hname = strtolower($parts[1]);

                if (($fp = @fopen('whois.gtld.' . $hname . '.php', 'r', 1)) and fclose($fp)) {
                    $this->query['handler'] = $hname;
                }
            }

            if (!empty($this->query['handler'])) {
                $this->query['file'] = sprintf('whois.gtld.%s.php', $this->query['handler']);
                $regrinfo = $this->process($subresult); //$result['rawdata']);
                $result['regrinfo'] = $this->mergeResults($result['regrinfo'], $regrinfo);
                //$result['rawdata'] = $subresult;
            }
        }

        return $result;
    }
1144807
public function getQuery($index, $field, &$result) {
		$con = null;
		if (isset($this->queries[ $field ])) {
			$con = $this->queries[ $field ];
		} else if (method_exists($this->view, $field)) {
			$con = $this->view->{$field}();
			/**@var Query $query */
			list($query, $fk, $lk) = $con;
			$query->where([$fk => $result[ $index ][ $lk ]]);
			$this->queries[ $field ] = $con;
		}

		if ($con) {
			/**@var Query $query */
			list($query, $fk, $lk) = $con;
			if (isset($result[ $index ][ $lk ])) {
				$idv = $result[ $index ][ $lk ];
				$query->updateWhereData([$fk => $idv]);

				return $query;
			}
		}

		return null;
	}
1200452
public function getTotalResult($start, $limit, $sortBy, $sortOrder, $params)
    {
        $results = $this->findAll($start, $limit, $sortBy, $sortOrder, $params);

        return count($results);
    }
1270663
private function doAfterQuery($result, $methodName, $arguments)
    {
        $traits = $this->getUsedTraits();

        if (in_array(CacheResults::class, $traits)) {
            // Reset caching to enabled in case it has just been disabled.
            $this->caching = true;
        }

        if (in_array(ThrowsHttpExceptions::class, $traits)) {

            if ($this->shouldThrowHttpException($result, $methodName)) {
                $this->throwNotFoundHttpException($methodName, $arguments);
            }

            $this->exceptionsDisabled = false;
        }

        return $result;
    }
1222801
public function getGoals($idSite)
    {
        $cacheId = self::getCacheId($idSite);
        $cache = $this->getGoalsInfoStaticCache();
        if (!$cache->contains($cacheId)) {
            // note: the reason this is secure is because the above cache is a static cache and cleared after each request
            // if we were to use a different cache that persists the result, this would not be secure because when a
            // result is in the cache, it would just return the result
            $idSite = Site::getIdSitesFromIdSitesString($idSite);

            if (empty($idSite)) {
                return array();
            }

            Piwik::checkUserHasViewAccess($idSite);

            $goals = $this->getModel()->getActiveGoals($idSite);

            $cleanedGoals = array();
            foreach ($goals as &$goal) {
                $cleanedGoals[$goal['idgoal']] = $this->formatGoal($goal);
            }

            $cache->save($cacheId, $cleanedGoals);
        }

        return $cache->fetch($cacheId);
    }
191895
protected function getFormUrl(Crawler $form)
    {
        $action = $form->form()->getUri();
        return $this->getAbsoluteUrlFor($action);
    }
547930
protected function getCrawler (string $output)
    {
        if ( $this->crawler ) {
            return $this->crawler;
        }

        return $this->crawler = new Crawler($output);
    }
1247044
private function getRole($result_area)
    {
        $role = [];
        $role['manga'] = $role['anime'] = [];
        $role_area = $result_area->find('td', 2)->find('small', 0);
        foreach ($role_area->find('a') as $each_role) {
            $temp_role = [];
            $parsed_role_id = explode('/', $each_role->href);

            $role_type = $parsed_role_id[1];
            $temp_role['id'] = $parsed_role_id[2];
            $temp_role['title'] = $each_role->plaintext;

            if ($temp_role['title']) {
                $role[$role_type][] = $temp_role;
            }
        }

        return $role;
    }