当前位置: 首页>>代码示例>>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;未经允许,请勿转载。