Retrieves a feed of recently featured videos.

@param mixed $location (optional) The URL to query or a
Zend_Gdata_Query object from which a URL can be determined
@return Zend_Gdata_YouTube_VideoFeed The feed of videos found at the
specified URL.
191466
public function getRecentlyFeaturedVideoFeed($location = null)
    {
        $standardFeedUri = self::STANDARD_RECENTLY_FEATURED_URI;

        if ($this->getMajorProtocolVersion() == 2) {
            $standardFeedUri = self::STANDARD_RECENTLY_FEATURED_URI_V2;
        }

        if ($location == null) {
            $uri = $standardFeedUri;
        } else if ($location instanceof Zend_Gdata_Query) {
            if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
                if (!isset($location->url)) {
                    $location->setFeedType('recently featured');
                }
            }
            $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_YouTube_VideoFeed');
    }
938056
public function getVideoByUrl(string $videoUrl): Video
	{
		$url = new Nette\Http\Url($videoUrl);

		if (stripos($url->host, 'youtu.be') !== false) {
			return $this->getVideo(trim($url->getPath(), '/'));
		}

		$videoId = $url->getQueryParameter('v');
		if (stripos($url->host, 'youtube.com') === false || $videoId === null) {
			throw new Nette\InvalidArgumentException('videoUrl must be valid youtube url.');
		}

		return $this->getVideo($videoId);
	}
347070
public function getMostViewedVideoFeed($location = null)
    {
        $standardFeedUri = self::STANDARD_MOST_VIEWED_URI;

        if ($this->getMajorProtocolVersion() == 2) {
            $standardFeedUri = self::STANDARD_MOST_VIEWED_URI_V2;
        }

        if ($location == null) {
            $uri = $standardFeedUri;
        } else if ($location instanceof Zend_Gdata_Query) {
            if ($location instanceof Zend_Gdata_YouTube_VideoQuery) {
                if (!isset($location->url)) {
                    $location->setFeedType('most viewed');
                }
            }
            $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_YouTube_VideoFeed');
    }
222362
public function getCellEntry($location)
    {
        if ($location instanceof Zend_Gdata_Spreadsheets_CellQuery) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }

        return parent::getEntry($uri, 'Zend_Gdata_Spreadsheets_CellEntry');
    }
680381
private function redirect($location)
    {
        $locationUrl = new Url($location);

        // if the location header was relative (bleh) add the host
        if (!$locationUrl->hasHost()) {
            $locationUrl = $this->url->getUrlForPath($location);
        }

        if ($this->redirects > self::MAXredirects) {
            throw new Error\BadRequest("Exceeded maximum redirects");
        }

        $this->redirects++;

        return $this->dispatchRequest(
            new Request('GET', $locationUrl, $this->headers)
        );
    }
755669
public function save(string $location = null): FedoraResource {
        if ($this->uri != '') {
            $meta = $this->getMetadata();
            $meta->merge($this->getAclMetadata(), [RC::idProp()]);
            $this->setMetadata($meta);
            $this->updateMetadata();
        } else {
            if ($location === null) {
                throw new InvalidArgumentException('location parameter missing');
            }

            $meta      = $this->getAclMetadata();
            $meta->addResource(RC::idProp(), 'https://id.acdh.oeaw.ac.at/acl/' . microtime(true) . rand(0, 1000));
            $res       = $this->fedora->createResource($meta, '', $location, 'POST');
            $this->uri = $res->getUri();
            $this->fedora->getCache()->delete($res);
            $this->fedora->getCache()->add($this);
        }
        return $this;
    }
396820
public function getDataFeed($uri = self::ANALYTICS_FEED_URI)
    {
        if ($uri instanceof Query) {
            $uri = $uri->getQueryUrl();
        }
        return parent::getFeed($uri, 'Zend_Gdata_Analytics_DataFeed');
    }
41823
private function getDestinations($name, $location)
    {
        $selected     = ($isHome = $location === '/') ? $name : "{$location}/{$name}";
        $destinations = $this->media->directories($location)
            ->pluck('path')
            ->reject(function ($path) use ($selected) {
                return $path === $selected;
            })
            ->values();

        if ( ! $isHome)
            $destinations->prepend('..');

        return $destinations;
    }
41227
public function showAction(Location $location)
    {
        if ($location->getProfile()->getId() != $this->getCurrentProfile()->getId())
        {
            throw new \Exception('No access to this Location');
        }

        return $this->render('HarvestCloudCoreBundle:Profile/Location:show.html.twig', array(
          'location' => $location,
        ));
    }
1336982
private function isMainLocation(Location $location)
    {
        $locationContentInfo = $this->contentHandler->loadContentInfo($location->contentId);

        return $locationContentInfo->mainLocationId === $location->id;
    }
652882
public function getVolumeFeed($location = null)
    {
        if ($location == null) {
            $uri = self::VOLUME_FEED_URI;
        } else if ($location instanceof Zend_Gdata_Query) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }
        return parent::getFeed($uri, 'Zend_Gdata_Books_VolumeFeed');
    }
1197818
public function fetch_request($request) {
        throw new coding_exception('Sorry, this function has been deprecated in Moodle 2.8.8, 2.9.2 and 3.0. Use block_tag_youtube::get_service instead.');

        $c = new curl(array('cache' => true, 'module_cache'=>'tag_youtube'));
        $c->setopt(array('CURLOPT_TIMEOUT' => 3, 'CURLOPT_CONNECTTIMEOUT' => 3));

        $response = $c->get($request);

        $xml = new SimpleXMLElement($response);
        return $this->render_video_list($xml);
    }
865822
public function getUserEntry($location)
    {
        if ($location === null) {
            require_once 'Zend/Gdata/App/InvalidArgumentException.php';
            throw new Zend_Gdata_App_InvalidArgumentException(
                    'Location must not be null');
        } else if ($location instanceof Zend_Gdata_Photos_UserQuery) {
            $location->setType('entry');
            $uri = $location->getQueryUrl();
        } else if ($location instanceof Zend_Gdata_Query) {
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }
        return parent::getEntry($uri, 'Zend_Gdata_Photos_UserEntry');
    }
1306089
public function getPdfLink($location, $timestamp = FALSE, $category = FALSE) {
    $query = [
      'font' => 'larger',
      'account' => GroupexRequestTrait::$account,
      'l' => $location,
    ];

    if ($timestamp) {
      $query['week'] = strtotime('Monday this week', $timestamp);
    }

    if ($category) {
      $query['c'] = $category;
    }

    return Url::fromUri(self::PRINT_URI, ['query' => $query]);
  }
357843
public function getSpreadsheetFeed($location = null)
    {
        if ($location == null) {
            $uri = self::SPREADSHEETS_FEED_URI;
        } else if ($location instanceof Zend_Gdata_Spreadsheets_DocumentQuery) {
            if ($location->getDocumentType() == null) {
                $location->setDocumentType('spreadsheets');
            }
            $uri = $location->getQueryUrl();
        } else {
            $uri = $location;
        }

        return parent::getFeed($uri, 'Zend_Gdata_Spreadsheets_SpreadsheetFeed');
    }
877847
public static function getDocumentIdFromLocation($location)
    {
        if (!is_string($location)) {
            // can't do anything about it if location is not even a string
            return null;
        }

        if (0 === strpos($location, '/_db/')) {
            // /_db/<dbname>/_api/document/<collection>/<key>
            @list(, , , , , $collectionName, $id) = explode('/', $location);
        } else {
            // /_api/document/<collection>/<key>
            @list(, , , $collectionName, $id) = explode('/', $location);
        }

        if (is_string($id)) {
            $id = urldecode($id);
        }

        return $collectionName . '/' . $id;
    }
662616
public static function convertLocationCoordinates(Location $location)
    {
        $coordinates = $location->getCoordinates()->getCoordinates();
        $coordinate = doubleval($coordinates[1]) . '%' . doubleval($coordinates[0]);
        $coordinate = strtr($coordinate, [
            '%'=>',',
            ','=>'.'
        ]);
        return $coordinate;
    }