include "header.php";
?>

<!-- Twitter intro -->

<?php 
require_once "inc/config.php";
require_once "inc/security.php";
require_once "inc/balance.php";
require_once "inc/TwitterConnector.php";
$uid = generateUid();
registerUid($uid);
$connector = new TwitterConnector();
$token = $connector->requestAccessToken();
$_SESSION["oauth_data"] = encryptMessage(json_encode($token), $key);
$url = $connector->getAuthUrl($token["oauth_token"]);
?>

  <h3>Okay, you chose Twitter as authentication method!</h3>
  <br />
  
  <div class="description">
    <p>Receive <strong><?php 
echo getAmountLabelLong("twitter");
?>
</strong> as reward.</p>

    <p>To <strong>redeem</strong> this reward, your need a Twitter account <strong>older than August 1, 2013</strong>. 
    Make also sure you follow <strong><a href="https://twitter.com/mscprotocol" target="_blank" 
    title="A Mastercoin related Twitter channel">@MSCProtocol</a></strong> on Twitter.</p>
function storeCookie($input)
{
    global $key;
    $encrypted = "msf" . encryptMessage($input, $key);
    setcookie("MSFSEC", $encrypted, strtotime('+1 year'), "/", "mastercoin-faucet.com", false, true);
}