Topic: oanda.com forex rates

Here is a code snippet that redirects to a page with the necessary forex rate but we need to capture the redirection in curl.

<?php
$from_curr = 'USD';
$to_curr = 'SGD';
$on_date = date('Y-m-d');
$form = <<<EOT
<form method="post" action="https://www1.oanda.com/currency/converter/" id="ncc_detail_form">
<input type="hidden" name="quote_currency_0" id="form_quote_currency_hidden" value="$from_curr" />
<input type="hidden" name="quote_amount" id="form_quote_amount_input_hidden" value="1" />
<input type="hidden" name="base_currency" id="form_base_currency_hidden" value="$to_curr" />
<input type="hidden" name="base_amount" id="form_base_amount_input_hidden" value="" />
<input type="hidden" name="last_action" id="form_last_action_hidden" value="" />
<input type="hidden" name="interbank_rates" id="form_interbank_rates_hidden" value="0" />
<input type="hidden" name="end_date" id="form_end_date_hidden" value="$on_date" />
<input type="hidden" name="language" id="form_language_hidden" value="en" />
<input type="hidden" name="view" id="form_view_hidden" value="details" />
<input type="submit" id="submit" name="submit" value="Submit" />
</form>
EOT;
echo $form;
?>
<script type="text/javascript">
window.onload = function(){
  document.getElementById('submit').click();
}
</script>

Even the Submit button can be "hidden".