當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TwitterOAuth::url方法代碼示例

本文整理匯總了PHP中Abraham\TwitterOAuth\TwitterOAuth::url方法的典型用法代碼示例。如果您正苦於以下問題:PHP TwitterOAuth::url方法的具體用法?PHP TwitterOAuth::url怎麽用?PHP TwitterOAuth::url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Abraham\TwitterOAuth\TwitterOAuth的用法示例。


在下文中一共展示了TwitterOAuth::url方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: login

 /**
  * Redirects the user to Twitter's API login page.
  *
  * @see https://dev.twitter.com/web/sign-in/implementing
  * @see https://twitteroauth.com/redirect.php
  */
 public function login()
 {
     $aRequestToken = $this->getRequestToken();
     if ($aRequestToken) {
         $sTwitterLoginUrl = $this->_oTwitterOAth->url('oauth/authorize', ['oauth_token' => $aRequestToken['oauth_token']]);
         URL::redirect($sTwitterLoginUrl);
     }
     return false;
 }
開發者ID:karlpatrickespiritu,項目名稱:ontrack,代碼行數:15,代碼來源:TwitterHandler.php

示例2: getUrlLogin

 public function getUrlLogin()
 {
     $connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret);
     $request_token = $connection->oauth('oauth/request_token', ['oauth_callback' => 'http://api.uhealth.com.br/v1/twitterCallback']);
     $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
     return $connection->url('oauth/authorize', ['oauth_token' => $request_token['oauth_token']]);
 }
開發者ID:silverwolfx10,項目名稱:tcc-uhealth,代碼行數:7,代碼來源:Twitter.php

示例3: getAuthorizationUrl

 public function getAuthorizationUrl(array $options = [])
 {
     $connection = new TwitterOAuth($this->clientId, $this->clientSecret);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $this->redirectUri));
     $options["session"]->write('twitter.request_token', $request_token);
     $url = $connection->url('oauth/authenticate', array('oauth_token' => $request_token['oauth_token']));
     return $url;
 }
開發者ID:kukiwasabi,項目名稱:oauth2-twitter,代碼行數:8,代碼來源:Twitter.php

示例4: getBotAuthorizeURL

 public static function getBotAuthorizeURL($route = "/")
 {
     $connection = new TwitterOAuth(CONSUMER_KEY_BOT, CONSUMER_SECRET_BOT);
     $response = $connection->oauth("oauth/request_token", array("oauth_callback" => "http://" . $_SERVER['SERVER_NAME'] . $route));
     $_SESSION['oauth_token_bot'] = $response['oauth_token'];
     $_SESSION['oauth_token_secret_bot'] = $response['oauth_token_secret'];
     $url = $connection->url("oauth/authorize", array("oauth_token" => $response['oauth_token']));
     return $url;
 }
開發者ID:xJakub,項目名稱:LCE,代碼行數:9,代碼來源:TwitterAuth.php

示例5: GenerateLoginLink

 function GenerateLoginLink()
 {
     $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
     $_SESSION['oauth_token'] = $request_token['oauth_token'];
     $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
     $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
     return $url;
 }
開發者ID:thinkingboxmedia,項目名稱:ShareAPI,代碼行數:9,代碼來源:twitter_verify.php

示例6: authorize

 public function authorize()
 {
     $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
     setcookie('oauth_token', $request_token['oauth_token']);
     setcookie('oauth_token_secret', $request_token['oauth_token_secret']);
     $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
     header("Location: {$url}");
 }
開發者ID:kriby,項目名稱:twitter_collage,代碼行數:9,代碼來源:Authorization.php

示例7: getAuthUrl

 public function getAuthUrl()
 {
     $connection = new TwitterOAuth(self::CONSUMER_KEY, self::CONSUMER_SECRET);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => self::OAUTH_CALLBACK));
     $_SESSION['oauth_token'] = $request_token['oauth_token'];
     $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
     $url = $connection->url('oauth/authenticate', array('oauth_token' => $request_token['oauth_token']));
     return $url;
 }
開發者ID:AlexSoicalap,項目名稱:login_con_twitter_php,代碼行數:9,代碼來源:TwitterOAuthHelper.php

示例8: getLoginStartUrl

 /**
  * Returns twitter login start auth process
  * 
  * @param string $redirecturl URL where to redirect after login complete
  */
 public function getLoginStartUrl($redirecturl)
 {
     $connection = new TwitterOAuth($this->options['consumer_key'], $this->options['consumer_secret']);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $redirecturl));
     $this->request_token = array();
     $this->request_token['oauth_token'] = $request_token['oauth_token'];
     $this->request_token['oauth_token_secret'] = $request_token['oauth_token_secret'];
     return $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
 }
開發者ID:gelembjuk,項目名稱:auth,代碼行數:14,代碼來源:Twitter.php

示例9: getAccessToken

 public function getAccessToken()
 {
     $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
     Session::put('oauth_token', $request_token['oauth_token']);
     Session::put('oauth_token_secret', $request_token['oauth_token_secret']);
     $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
     return $url;
 }
開發者ID:numair1,項目名稱:NumairFeestr,代碼行數:9,代碼來源:twitterController.php

示例10: twitter

 public function twitter()
 {
     $connection = new TwitterOAuth(Config::get('twitter.appid'), Config::get('twitter.secret'));
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => Config::get('twitter.callback')));
     $_SESSION['login_type'] = "twitter";
     $_SESSION['oauth_token'] = $request_token['oauth_token'];
     $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
     $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
     return redirect($url);
 }
開發者ID:CoffeeOwl17,項目名稱:Cruises-Booking,代碼行數:10,代碼來源:login_controller.php

示例11: action_signInWithTwitter

 public function action_signInWithTwitter()
 {
     $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
     //echo var_dump($request_token);
     $_SESSION['oauth_token'] = $request_token['oauth_token'];
     $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
     $url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
     header("Location: " . $url);
     die;
 }
開發者ID:jayeshlata,項目名稱:startupftw-php,代碼行數:11,代碼來源:Welcome.php

示例12: authorizeURL

 /**
  * Generate Authorization URL
  *
  * Generate an authorization URL twitter.
  *
  * @return string
  * @throws Exception
  */
 public function authorizeURL()
 {
     $twitter = new TwitterOAuth($this->config->get('twitter', 'consumer'), $this->config->get('twitter', 'secret'));
     $twitter->setDecodeJsonAsArray(true);
     $requestToken = $twitter->oauth('oauth/request_token', array('oauth_callback' => Utility::buildFullLink($this->config, false, 'session/callback/twitter')));
     if ($requestToken['oauth_callback_confirmed'] != true) {
         throw new Exception("OAuth Callback was not confirmed.");
     }
     $this->session->setTMP('twitter_request_token', $requestToken);
     $url = $twitter->url('oauth/authorize', array('oauth_token' => $this->session->getTMP('twitter_request_token')['oauth_token']));
     return $url;
 }
開發者ID:ZacharyDuBois,項目名稱:Digital-Footprint-Profile,代碼行數:20,代碼來源:Twitter.php

示例13: _redirectFlow

 private function _redirectFlow()
 {
     $conn = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
     //リクエストトークンをセットする、コールバックURKを渡す
     $tokens = $conn->oauth('oauth/request_token', ['oauth_callback' => CALLBACK_URL]);
     // 後で利用できるようにsessionに保存する
     $_SESSION['oauth_token'] = $tokens['oauth_token'];
     $_SESSION['oauth_token_secret'] = $tokens['oauth_token_secret'];
     // redirect アカウントの利用を許可しますか?へ飛ばす
     $authorizeUrl = $conn->url('oauth/authorize', ['oauth_token' => $tokens['oauth_token']]);
     header('Location: ' . $authorizeUrl);
     exit;
 }
開發者ID:johnmanjiro,項目名稱:first_app,代碼行數:13,代碼來源:Twitterlogin.php

示例14: getauthorizeurl

 public function getauthorizeurl()
 {
     $ret = null;
     $twitter_oauth_callback = site_url('user/signup');
     $connection = new TwitterOAuth($this->twitter_app_id, $this->twitter_api_secret);
     $connection->setTimeouts(10, 15);
     //To prevent timeout error
     $request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $twitter_oauth_callback));
     $_SESSION['oauth_token'] = $request_token['oauth_token'];
     $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
     $ret = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
     return $ret;
 }
開發者ID:arunmisra2273,項目名稱:punu,代碼行數:13,代碼來源:Twalib.php

示例15: _redirectFlow

 private function _redirectFlow()
 {
     $conn = new TwitterOAuth(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
     // 認証リクエスト用トークン発行
     $tokens = $conn->oauth('oauth/request_token', ['oauth_callback' => TWITTER_CALLBACK_URL]);
     // 認証リクエスト用トークンの保持
     $_SESSION['tmp_twitter_oauth_token'] = $tokens['oauth_token'];
     $_SESSION['tmp_twitter_oauth_token_secret'] = $tokens['oauth_token_secret'];
     // Twitterの認証畫麵へリダイレクトさせる
     $authorizeUrl = $conn->url('oauth/authorize', ['oauth_token' => $tokens['oauth_token']]);
     header('Location: ' . $authorizeUrl);
     exit;
 }
開發者ID:a-tagai,項目名稱:login_app,代碼行數:13,代碼來源:AuthTwitter.php


注:本文中的Abraham\TwitterOAuth\TwitterOAuth::url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。