Get the param __VIEWSTATE

@param string $url
@param bool   $force
@param string $selector

@return string
@throws HttpException
10718
protected function getViewsState($url = '', $force = false, $selector = '__VIEWSTATE')
    {
        $url = $url ?: Config::get('url.main_page');
        $cacheKey = 'view_state-' . $this->getUserName() . '-' . md5($url);
        if ($force || !$viewState = $this->getCache()->fetch($cacheKey)) {
            $response = $this->request('get', [$url]);

            if (!$response) {
                throw new HttpException('get the param v failed', 10001);
            }

            if (!$viewState = Parser::fieldName($response->getBody(), $selector)) {
                throw new HttpException('get the param v failed', 10001);
            }

            $this->getCache()->save($cacheKey, $viewState, Config::get('cache.expire', 100));
        }

        return $viewState;
    }
549911
public function setButtonCheckboxAction(
        string $url = null,
        string $addPostUrl = null,
        string $text = null,
        string $confirmText = null,
        string $class = null,
        string $icon = ''
    ): ButtonInterface {
        $addPostUrl = $addPostUrl ?: '?deleted=';
        $class = $class ?: 'btn btn-default btn-outline-primary js_btnCustomAction js_linkDelete';
        $text = $text ?: GridView::trans('grid.selectDelete');
        $confirmText = $confirmText ?: GridView::trans('grid.clickDelete');

        return $this->setActionCustom($url . $addPostUrl, $text, $class, $icon)
            ->setAction(self::TYPE_ACTION_CUSTOM)
            ->setConfirmText($confirmText)
            ->setOptions([
                'data-url'     => $this->getUrl(),
                'data-confirm' => $confirmText,
            ]);
    }
109087
public function fetchButton($type = 'Help', $url = '#', $width = 700, $height = 500)
	{
		$text  = \Lang::txt('JTOOLBAR_HELP');
		$class = $this->fetchIconClass('help');
		$msg   = \Lang::txt('JHELP', true);

		if (!strstr('?', $url)
		 && !strstr('&', $url)
		 && substr($url, 0, 4) != 'http')
		{
			$url = \Route::url('index.php?option=com_help&component=' . \Request::getCmd('option') . '&page=' . $url);
		}
		else
		{
			$url = $this->_getCommand($ref = $type, $com = false, $override = false, $component = \Request::getCmd('option'));
		}

		$html  = '<a href="' . $url . '" data-title="' . $text . '" data-message="' . $msg. '" data-width="' . $width . '" data-height="' . $height . '" rel="help" class="toolbar toolbar-popup">' . "\n";
		$html .= '<span class="' . $class . '">' . "\n";
		$html .= $text . "\n";
		$html .= '</span>' . "\n";
		$html .= '</a>' . "\n";

		return $html;
	}
1346663
public function getAuthUrl($callbackUrl = null, $state = null, $scope = null)
	{
		$option = array(
			'client_id'			=>	$this->appid,
			'redirect_uri'		=>	null === $callbackUrl ? $this->callbackUrl : $callbackUrl,
			'scope'				=>	null === $scope ? $this->scope : $scope,
			'state'				=>	$this->getState($state),
			'allow_signup'		=>	$this->allowSignup,
		);
		if(null === $this->loginAgentUrl)
		{
			return $this->getAuthLoginUrl('login/oauth/authorize', $option);
		}
		else
		{
			return $this->loginAgentUrl . '?' . $this->http_build_query($option);
		}
	}
1228786
public function configureSelector(PaginatorAwareInterface $selector)
    {
        if (empty($this->state)) {
            throw new ListingException("Unable to pagination without state being set");
        }

        $this->validateSelector($selector);

        foreach ($this->activeFilters() as $filter) {
            $selector = $filter->apply($selector);
        }

        if (!empty($sorter = $this->activeSorter())) {
            $selector = $sorter->apply($selector);
        }

        //Pagination
        $selector->setPaginator($this->createPaginator());

        return $selector;
    }
1162032
def get_image_url(self, selector, by=By.CSS_SELECTOR,
                      timeout=settings.SMALL_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        return self.get_attribute(selector,
                                  attribute='src', by=by, timeout=timeout)
1310564
public function get($url, $parameters = [])
    {
        $httpClient = $this->client->getHttpClient();

        if (!empty($this->pager)) {
            $parameters['page'] = $this->pager->getPage();
            $parameters['perPage'] = $this->pager->getResultsPerPage();
        }

        $response = $httpClient->get($url, ['query' => $parameters]);

        return $httpClient->parseResponse($response);
    }
820037
public static function button($url, $params = array())
    {
        // configuration
        $config = self::config();

        // no configuration file
        if (!$config) {
            return null;
        }

        // Params
        $color = (isset($params['color']) && $params['color'] == "white") ? "white" : "blue";
        $style = (isset($params['style']) && $params['style'] == "button") ? "button" : "flat";

        return '<script type="text/javascript" src="https://clef.io/v3/clef.js" class="clef-button" data-app-id="'.$config['app_id'].'" data-color="'.$color.'" data-style="'.$style.'" data-redirect-url="'. $url . '"></script>';
    }
19079
protected function _get($url, $parameters = null, $scopes = [], $class = null) {
        $client = new HttpClient($this->patrol, 'get', $url, $parameters);

        $client->setScopes($scopes);

        $data = $client->response();

        if (isset($data['error'])) {
            $this->_error($data);
        }

        $data = $data['data'];

        $callee = $class ? $class : get_called_class();
        return Util::parseResponseToPatrolObject($this->patrol, $data, $callee, $this->defaults);
    }
1206978
private function getRemoteData(string $url): ResponseInterface
    {
        $this->init($url);
        $version = '1.1';

        $response = curl_exec($this->resource);

        if (false === $response) {
            throw new Exception('could not initialize the connection to load the data');
        }

        $httpCode   = curl_getinfo($this->resource, CURLINFO_HTTP_CODE);
        $headerSize = curl_getinfo($this->resource, CURLINFO_HEADER_SIZE);

        $this->close();

        $rawHeaders = explode("\r\n", trim(mb_substr($response, 0, $headerSize)));
        $headers    = [];

        foreach ($rawHeaders as $rawHeader) {
            $parts  = explode(':', $rawHeader, 2);
            $header = $parts[0];

            if (isset($parts[1])) {
                $value = trim($parts[1]);
            } else {
                $value = '';
            }

            $headers[$header] = $value;
        }

        $body = mb_substr($response, $headerSize);

        return new Response($httpCode, $headers, $body, $version);
    }
3779
public function urlAdd(string $action, $data = null, string $url = null): string
    {
        if ($this->viaApi($action)) {
            $action = $this->addApiVersion($action);
        }
        $url = $this->urlRemove($url ?: $this->bestUrl($action));

        // $url = $this->c::removeUrlQueryArgs(['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'], $url);
        // `utm_*` variables are stripped to avoid duplicate sessions as a result of reposting to a URL that included them.
        // Duplicated sessions occur in GA; i.e., a new set of `utm_*` vars triggers a new GA session. Need to avoid this.
        // @TODO ↑ Instead of stripping these away, convert them to `utm-*` internal variables.

        $url = $this->c::addUrlQueryArgs([$this->var => $action, $this->data_var => $data], $url);
        // NOTE: If `$data` is null, it will simply not be included in the URL.

        if (!empty($this->registered_actions[$action]['requires_valid_nonce'])) {
            $url = $this->s::addUrlNonce($url, $action);
        }
        return $url;
    }
781812
protected function parseActionUrl($url, $action = null, $renderer = null)
    {
        unset($action);

        if ($renderer === null) {
            $renderer = $this->getActionRenderer();
        }

        if ($url instanceof Translation) {
            $url = (string)$url;
        }

        $url = trim($url);

        if (empty($url) && !is_numeric($url)) {
            return '#';
        }

        if ($renderer === null) {
            /** @todo Shame! Force `{{ id }}` to use "obj_id" GET parameter… */
            $objId = filter_input(INPUT_GET, 'obj_id', FILTER_SANITIZE_STRING);
            if ($objId) {
                $url = preg_replace('~\{\{\s*(obj_)?id\s*\}\}~', $objId, $url);
            }

            /** @todo Shame! Force `{{ type }}` to use "obj_type" GET parameter… */
            $objType = filter_input(INPUT_GET, 'obj_type', FILTER_SANITIZE_STRING);
            if ($objType) {
                $url = preg_replace('~\{\{\s*(obj_)?type\s*\}\}~', $objType, $url);
            }

            if ($url && strpos($url, ':') === false && !in_array($url[0], [ '/', '#', '?' ])) {
                $url = $this->adminUrl().$url;
            }

            return $url;
        } elseif ($renderer instanceof ViewableInterface) {
            $url = $renderer->renderTemplate($url);

            if ($url && strpos($url, ':') === false && !in_array($url[0], [ '/', '#', '?' ])) {
                $url = $this->adminUrl().$url;
            }
        }

        return $url;
    }
527419
private static URL getUrlValueFromRow(QuerySolution resultRow, String variableName) {

        // Check the input and exit immediately if null
        if (resultRow == null) {
            return null;
        }
        URL result = null;
        Resource res = resultRow.getResource(variableName);

        // Ignore and track services that are blank nodes
        if (res.isAnon()) {
            log.warn("Blank node found and ignored " + res.toString());
        } else if (res.isURIResource()) {
            try {
                result = new URL(res.getURI());
            } catch (MalformedURLException e) {
                log.error("Malformed URL for node", e);
            } catch (ClassCastException e) {
                log.error("The node is not a URI", e);
            }
        }

        return result;
    }
139155
function querySelectorOnBrowser(selector) {
        // stupid error catching here to stop the browser from printing null cannot be found to stdout
        var query;
        try {
            // do this to simulate a scroll to the bottom of the page to trigger loading of certain ajax elements
            //todo somehow this still doesnt work
            document.body.scrollTop = 0;
            document.body.scrollTop = 9999999999;
            //window.document.body.scrollTop = document.body.scrollHeight;
            query = document.querySelector(selector).innerHTML;

        } catch (exception) {
            return false;
        }
        return true;
    }
802710
public function setButtonExport(string $url = null): ButtonInterface
    {
        $addUrl = 'export=1';
        if (!$url) {
            $url = url()->current();
        }
        if ($array = request()->except('export')) {
            $url .= '?' . http_build_query($array);
        }
        $addUrl = \Illuminate\Support\Str::is('*?*', $url) ? '&' . $addUrl : '?' . $addUrl;
        $text = GridView::trans('grid.export');

        return $this->setActionCustom($url . $addUrl, $text, 'btn btn-default btn-outline-primary', 'fa fa-download')
            ->setAction(self::TYPE_ACTION_EXPORT)
            ->setId('js_amiExportButton');
    }
108902
function getQueryParameterValue(url, parameterName) {
        var parts;
        var query = (url || '').split('?');
        if (query && query.length > 0) {
            parts = query[1];
        }
        else {
            parts = '';
        }
        var vars = parts.split('&');
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split('=');
            if (decodeURIComponent(pair[0]) == parameterName) {
                return decodeURIComponent(pair[1]);
            }
        }
        // not found
        return null;
    }
485148
protected function _getCssOutput(array $options, $url)
    {
        if ($options['rel'] === 'import') {
            return $this->formatTemplate('style', [
                'attrs'   => $this->templater()->formatAttributes($options, ['rel', 'block', 'weight', 'alias']),
                'content' => '@import url(' . $url . ');',
            ]);
        }

        return $this->formatTemplate('css', [
            'rel'   => $options['rel'],
            'url'   => $url,
            'attrs' => $this->templater()->formatAttributes($options, ['rel', 'block', 'weight', 'alias']),
        ]);
    }