private function fetchUserId()
  {
    $pool = Registry::getStash();

    $cache = $pool->getItem('nyaa/user/'.$this->getTorrentId());

    if ($cache->isMiss()) {
      // sadly we have to use the site since nothing provides the user id
      $userId = false;
      $html = file_get_contents($this->siteUrl);

      // lets not depend on the actual domain
      if(preg_match('~\/\?user\=([0-9]+)~i', $html, $match)) {
        $userId = intval($match[1]);
      }

      $cache->set($userId);
    }

    return $cache->get();
  }
private function fetchUserId()
  {
    $pool = Registry::getStash();

    $cache = $pool->getItem('nyaa/user/'.$this->getTorrentId());

    if ($cache->isMiss()) {
      // sadly we have to use the site since nothing provides the user id
      $userId = false;
      $html = file_get_contents($this->siteUrl);

      // lets not depend on the actual domain
      if(preg_match('~\/\?user\=([0-9]+)~i', $html, $match)) {
        $userId = intval($match[1]);
      }

      $cache->set($userId);
    }

    return $cache->get();
  }
private function fetchUserId ( ) { $ pool = Registry :: getStash ( ) ; $ cache = $ pool -> getItem ( 'nyaa/user/' . $ this -> getTorrentId ( ) ) ; if ( $ cache -> isMiss ( ) ) { // sadly we have to use the site since nothing provides the user id $ userId = false ; $ html = file_get_contents ( $ this -> siteUrl ) ; // lets not depend on the actual domain if ( preg_match ( '~\/\?user\=([0-9]+)~i' , $ html , $ match ) ) { $ userId = intval ( $ match [ 1 ] ) ; } $ cache -> set ( $ userId ) ; } return $ cache -> get ( ) ; }
Gets the user id by getting the overview of the torrent page and looking for the user id there
@return int
Gets the user id by getting the overview of the torrent page and looking for the user id there