Skip to content

Instantly share code, notes, and snippets.

@nand2
Created May 29, 2014 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nand2/1dc30b5081ba9b772516 to your computer and use it in GitHub Desktop.
Save nand2/1dc30b5081ba9b772516 to your computer and use it in GitHub Desktop.
<?php
// Config
$base_api_url = "https://www.betarigs.com/api/v1";
$rig_id = 4737;
echo "[" . date('Y-m-d H:i:s') . "] Getting infos about rig $rig_id ...\n";
$url = $base_api_url . '/rig/' . $rig_id;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
$rig_data = json_decode($result, true);
print_r($rig_data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment