Get the list of top rated tvs. By default, this list will only include tvs that have 10 or more votes.
This list refreshes every day.

@param  array $options
@param  array $headers
@return Tv[]
184478
public function getTopRated(array $options = [], array $headers = [])
    {
        return $this->getFactory()->createResultCollection(
            $this->getApi()->getTopRated($options, $headers)
        );
    }
1014236
public function find(array $parameters = [], array $headers = [])
    {
        $resolver = new OptionsResolver();

        $resolver->setDefined('subscription_id')
            ->setAllowedTypes('subscription_id', 'string')
            ->setRequired('subscription_id');

        $resolver->setDefined('label')
            ->setAllowedTypes('label', 'string')
            ->setRequired('label');

        $url = $this->url('addresses');

        return $this->get($url, $resolver->resolve($parameters), $headers);
    }
411667
protected function getHeaderOptions($options)
    {
        $headerOptions = $options['header-options'];

        $inheritableOptions = $this->getInheritableOptions();

        foreach ($inheritableOptions as $inheritableOption) {
            $headerOptions[$inheritableOption] =
                isset($headerOptions[$inheritableOption])
                ? $headerOptions[$inheritableOption]
                : $options[$inheritableOption];
        }

        return $headerOptions;
    }
707763
public function getLists(array $options = array())
    {

        $uri = $this->buildUserResourceUri('lists');
        $response = $this->makeAuthenticatedApiRequest($uri, $options);

        return $response->lists;

    }
352972
protected function incrementHeaders(array $headers)
    {
        $incrementedHeaders = [];
        foreach (array_count_values($headers) as $header => $count) {
            if ($count > 1) {
                $incrementedHeaders[] = $header;
                for ($i = 1; $i < $count; $i++) {
                    $incrementedHeaders[] = $header . $i;
                }
            } else {
                $incrementedHeaders[] = $header;
            }
        }

        return $incrementedHeaders;
    }
212012
public function getAiringToday(array $options = [], array $headers = [])
    {
        return $this->getFactory()->createResultCollection(
            $this->getApi()->getAiringToday($options, $headers)
        );
    }
253074
public function searchList($query, array $parameters = [], array $headers = [])
    {
        return $this->get('search/list', array_merge($parameters, [
            'query' => $query
        ], $headers));
    }
1348865
public function bitcoincharts($options = []) {
		$options += $this->settings;
		$url = 'http://api.bitcoincharts.com/v1/markets.json';
		$res = $this->_getBitcoincharts($url);
		if (!$res) {
			return false;
		}
		$array = [];
		foreach ($res as $val) {
			$array[$val['currency']] = $val;
			unset($array[$val['currency']]['currency']);
		}

		if (empty($options['currency'])) {
			return $array;
		}
		if (empty($array[$options['currency']])) {
			return false;
		}
		return $array[$options['currency']];
	}
1333821
private function rebuildHeader(array $headers)
    {
        $header = [];

        foreach ($headers as $entry) {
            $header[$entry['name']][] = $entry['value'];
        }

        return $header;
    }
1248205
public function search(array $options)
    {
        $options = Options::buildOptions(Options::$defaultOptions, $options, $this);

        $deferred = new Deferred();

        $this->http->get(Endpoints::SEARCH.$options)->then(function ($response) use ($deferred) {
            $collection = new Collection();

            foreach ($response as $key => $values) {
                if ($key == 'artists') {
                    $artists = new Collection();

                    foreach ($values['items'] as $value) {
                        $artists->push(new Artist($this->http, $this, $value));
                    }

                    $collection['artists'] = $artists;
                } elseif ($key == 'albums') {
                    $albums = new Collection();

                    foreach ($values['items'] as $value) {
                        $albums->push(new Album($this->http, $this, $value));
                    }

                    $collection['albums'] = $albums;
                } elseif ($key == 'playlists') {
                    $playlists = new Collection();

                    foreach ($values['items'] as $value) {
                        $playlists->push(new Playlist($this->http, $this, $value));
                    }

                    $collection['playlists'] = $playlists;
                } elseif ($key == 'tracks') {
                    $tracks = new Collection();

                    foreach ($values['items'] as $value) {
                        $tracks->push(new Track($this->http, $this, $value));
                    }

                    $collection['tracks'] = $tracks;
                } elseif ($key == 'videos') {
                    $videos = new Collection();

                    foreach ($values['items'] as $value) {
                        $videos->push(new Video($this->http, $this, $value));
                    }

                    $collection['videos'] = $videos;
                }
            }

            $deferred->resolve($collection);
        }, function ($e) use ($deferred) {
            $deferred->reject($e);
        });

        return $deferred->promise();
    }
879835
protected function getRateLimit(array $headers)
    {
        $rateLimit = array(
            'limit' => '?',
            'reset' => '?',
        );

        foreach ($headers as $header) {
            $header = trim($header);
            if (false === strpos($header, 'X-RateLimit-')) {
                continue;
            }
            list($type, $value) = explode(':', $header, 2);
            switch ($type) {
                case 'X-RateLimit-Limit':
                    $rateLimit['limit'] = (int) trim($value);
                    break;
                case 'X-RateLimit-Reset':
                    $rateLimit['reset'] = date('Y-m-d H:i:s', (int) trim($value));
                    break;
            }
        }

        return $rateLimit;
    }
1078620
public function getContents(array $options=array()){
		$options['quality']=isset($options['quality'])?$options['quality']:80;
		ob_start();
		@imagejpeg($this->resource,null,$options['quality']);
		return ob_get_clean();
	}
197598
public function loadMovieCollection(array $parameters = [], array $headers = [])
    {
        return $this->createCollection(
            $this->getApi()->getMovieGenres($parameters, $headers)
        );
    }
1073897
protected function _getRateLimitInfo($headers)
  {
    if (! isset($headers['x-rate-limit-limit'])) {
      return null;
    }
    $rate = [
      'limit'     => $headers['x-rate-limit-limit'],
      'remaining' => $headers['x-rate-limit-remaining'],
      'reset'     => $headers['x-rate-limit-reset']
    ];
    if ($this->_return_format === CODEBIRD_RETURNFORMAT_OBJECT) {
      return (object) $rate;
    }
    return $rate;
  }
365530
public function discoverTv(DiscoverTvQuery $query, array $headers = [])
    {
        $data = $this->getApi()->discoverTv($query->toArray(), $headers);

        return $this->getTvFactory()->createResultCollection($data);
    }
505703
public function getMovieList(array $parameters = [], array $headers = [])
    {
        $data  = $this->getApi()->getMovieList($this->parseQueryParameters($parameters), $headers);

        return $this->getFactory()->createCollection($data);
    }
1309466
protected function headers($headers)
    {
        $headers = collect($headers)->map(function ($header) {
            return $header[0];
        })->toArray();

        return $this->hideParameters($headers,
            Telescope::$hiddenRequestHeaders
        );
    }