Пример #1
0
 private function authorize()
 {
     if ($this->regionService->getRegion() != RegionService::RU_REGION) {
         throw new RuntimeException('Need authorize', 403);
     }
     $this->createClient(true, true);
     $authOptions = $this->regionService->getAuthOptions();
     /** @var ResponseInterface $response */
     if ($authOptions['method'] == 'GET') {
         $response = $this->client->get($authOptions['url']);
     } elseif ($authOptions['method'] == 'POST') {
         $response = $this->client->post($authOptions['url'], array('body' => $authOptions['data']));
     }
     $this->client->get($this->regionService->getProjectUrl() . 'skyforgenews');
     $this->exportCookie();
     //        foreach ($this->history->getRequests() as $request) {
     //            echo $request->getUrl() ."\n";
     //        }
     echo "authorize!\n";
     $this->tryAuthorize = true;
 }
 private function makeCommunitiesMoreUrl()
 {
     return $this->regionService->getProjectUrl() . 'communities.morebutton:loadbunch';
 }
Пример #3
0
 /**
  * @param string $playerId
  *
  * @return string
  */
 public function makeProfileUrlByPlayerId($playerId)
 {
     return sprintf('%suser/avatar/%s', $this->regionService->getProjectUrl(), $playerId);
 }
 private function makeCommunityMembersMoreUrl($id)
 {
     return sprintf($this->regionService->getProjectUrl() . 'community/members.morebutton:loadbunch?t:ac=%s', $id);
 }