Permalink
Browse files

Cleaned up text.

  • Loading branch information...
1 parent bfebd2f commit 98b4f0d624f7a7163738bc63d65e870d0cd16777 @abraham committed Mar 11, 2010
Showing with 8 additions and 8 deletions.
  1. +2 −2 connect.php
  2. +6 −6 redirect.php
View
@@ -2,7 +2,7 @@
/**
* @file
- * Get a request token from twitter and present authorization URL to user
+ * Check if consumer token is set and if so send user to get a request token.
*/
/**
@@ -17,5 +17,5 @@
/* Build an image link to start the redirect process. */
$content = '<a href="./redirect.php"><img src="./images/lighter.png" alt="Sign in with Twitter"/></a>';
-/* Include HTML to display on the page */
+/* Include HTML to display on the page. */
include('html.inc');
View
@@ -1,28 +1,28 @@
<?php
-/* Start session and load lib */
+/* Start session and load library. */
session_start();
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');
/* Create TwitterOAuth object and get request token */
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
-/* Get request token */
+/* Get request token. */
$request_token = $connection->getRequestToken(OAUTH_CALLBACK);
-/* Save request token to session */
+/* Save request token to session. */
$_SESSION['oauth_token'] = $token = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
-/* If last connection fails don't display authorization link */
+/* If last connection fails don't display authorization link. */
switch ($connection->http_code) {
case 200:
- /* Build authorize URL */
+ /* Build authorize URL and redirect user to Twitter. */
$url = $connection->getAuthorizeURL($token);
header('Location: ' . $url);
break;
default:
+ /* Show notification if something went wrong. */
echo 'Could not connect to Twitter. Refresh the page or try again later.';
- break;
}

0 comments on commit 98b4f0d

Please sign in to comment.