Search site



Follow Dashhacks and Win Free Shit!

04/03/2011 18:27


Follow Dashhacks and Win Free Shit!

It's that time again — time to give free shit away to our loyal readers and followers! What are we giving away? Whatever console you want! I'm talking PS3's, Xbox 360's, PSP's — you pick! It's going down like this:

Follow us on Twitter and ensure your last tweet (when the draw happens) contains "@dashhacks" — and boom! You're automatically entered. Now for every 1000 followers, on each thousandth milestone, like 7000, 8000 for example, up to and including 10,000, we'll pick a random winner. You'll then be contacted and asked what you want from the *Prize Pool. Before a draw happens we'll let everyone know (via Twitter) so you can get your @dashhacks tweet in to qualify.

*Prize Pool

The prize pool works like this: You can pick whatever console you want up to a $400 (CAD) value. That could be the PS3 320GB Move Bundle, the Xbox 360 250GB Kinect Bundle, two PSPgo's (one for you, one for your buddy), etc. Or you can optionally cash out and take $400 PayPal. *The choice is yours.

*The choice is yours

Only if you're a resident of Canada or the US of A. Shipping large [electronic] items across borders through customs really sucks, even for US citizens (we're Canadian), but we're prepared to absorb that cost because you're awesome. But know this: As a US citizen you'll likely face importing duties on said electronics. For contest participants residing elsewhere: You may still participate and you're still awesome; however, your only option is the cash prize of $400 CAD.

Below is the code that we'll use for the lotto-style draw. It's this simple. My IP is used so you don't exhaust Twitter's API request limit when draw time comes. Here — — is where the draw will happen.

if ((int)$_GET['draw'] === 1 && $_SERVER['REMOTE_ADDR'] === )  {
  $name = $tweet = $tried = FALSE;
  $followers_url = '';
  $follower_ids = json_decode(trim(file_get_contents($followers_url)));
  while (!$name) {
    $winning_key = rand(0, sizeof($follower_ids) - 1);
    $winner_url = ''.$follower_ids[$winning_key];
    $winner = json_decode(trim(file_get_contents($winner_url)));
    if (strstr($winner->status->text, '@dashhacks')) {
      $name = $winner->screen_name;
      $tweet = $winner->status->text;
    if ($tried > 50) {
      drupal_set_message('Please try again.');