Created
April 4, 2017 21:19
-
-
Save Sam-Jenkins/d229c780e21453b15b97ec127286a7ee to your computer and use it in GitHub Desktop.
How far away is the moon?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// enter your RCA ID here | |
$id = 'ex4mp13-ex4mp13-ex4mp13-ex4mp13'; | |
// get the data we need from the API | |
$data = file_get_contents('http://api.burningsoul.in/moon'); | |
$objMoon = json_decode($data); | |
// package up the data to send to the RCA monitor | |
$payload = [ | |
'id'=>$id, | |
'DFCOE'=>$objMoon->DFCOE, | |
'DFS'=>$objMoon->DFS | |
]; | |
// POST the data to the RCA | |
$ch = curl_init('https://results.rapidspike.com/rca/'); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$result = curl_exec($ch); | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment