<?php 
	$currency = $_GET['currency'];

	$ch = curl_init("https://api-fxtrade.oanda.com/labs/v1/calendar?period=-3600");
        $header = array();
        $header[] = 'Content-type: application/json';
        $header[] = 'Authorization: Bearer 7ce69aaf540b018fbfd25610bbe8a337-ce39b157321de34d97e8856b6f1c0a67';
        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        $result = curl_exec($ch);
        $result = json_decode($result, true);
        // Store the values returned from cURL execution
	
        //print_r($result);
        foreach($result as $r)
        {
	        echo $r['title'] . "_" . $r['impact'] . '_'. date('H', $r['timestamp']) .  "_" . $r['currency'] . "|";
        }
        ?>