Find Jobs
Hire Freelancers

Convert php code to java for beter.com access - repost

$10-30 AUD

Terminado
Publicado hace más de 10 años

$10-30 AUD

Pagado a la entrega
I am working on a trading bot for [login to view URL] but I cannot get the code to work correctly. Their web page lists an example in php see [login to view URL] What I like is the function bter_query php to be rewritten in java. The result should be that the function can be called and obtain the balance for the currency on the web site. I will supply the key and secret the function requires. Thus the delivery for this project is a single java file that when run will obtain the balances from [login to view URL] You are free to use additional free libraries like those supplied from Apache as required. Below is the example from their web site. I have removed a few lines as they run examples not required. Hopefully it will still run in php and all you need to do is convert it to java. <?php function bter_query($path, array $req = array()) { // API settings, add your Key and Secret at here $key = ''; $secret = ''; // generate a nonce to avoid problems with 32bits systems $mt = explode(' ', microtime()); $req['nonce'] = $mt[1].substr($mt[0], 2, 6); // generate the POST data string $post_data = http_build_query($req, '', '&'); $sign = hash_hmac('sha512', $post_data, $secret); // generate the extra headers $headers = array( 'KEY: '.$key, 'SIGN: '.$sign, ); // curl handle (initialize if required) static $ch = null; if (is_null($ch)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; Bter PHP bot; '.php_uname('a').'; PHP/'.phpversion().')' ); } curl_setopt($ch, CURLOPT_URL, '[login to view URL]'.$path); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $res = curl_exec($ch); if ($res === false) throw new Exception('Curl error: '.curl_error($ch)); //echo $res; $dec = json_decode($res, true); if (!$dec) throw new Exception('Invalid data: '.$res); return $dec; } function get_top_rate($pair, $type='BUY') { $rate = 0; // our curl handle (initialize if required) static $ch = null; if (is_null($ch)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; Bter PHP bot; '.php_uname('a').'; PHP/'.phpversion().')' ); } curl_setopt($ch, CURLOPT_URL, '[login to view URL]'.$pair); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $res = curl_exec($ch); if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch)); //echo $res; $dec = json_decode($res, true); if (!$dec) throw new Exception('Invalid data: '.$res); if (strtoupper($type) == 'BUY') { $r = $dec['bids'][0]; $rate = $r[0]; } else { $r = end($dec['asks']); $rate = $r[0]; } return $rate; } try { // example 1: get funds var_dump(bter_query('1/private/getfunds')); } catch (Exception $e) { echo "Error:".$e->getMessage(); } ?>
ID del proyecto: 5252609

Información sobre el proyecto

7 propuestas
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi, I can convert the php code to java and get the balance for the currency. DO you want it as standalone Java application? To brief about me, I have 6+ years of experience in Java/j2EE technologies with SCJP/SCBCD certification. Looking forward to work on this. REgards
$30 AUD en 1 día
5,0 (16 comentarios)
4,6
4,6
7 freelancers están ofertando un promedio de $64 AUD por este trabajo
Avatar del usuario
We are an experienced team of php developers. we will provide you complete Solution as per your need
$149 AUD en 3 días
4,6 (37 comentarios)
5,6
5,6
Avatar del usuario
Hello, I have read through your project and I am incredibly interested in taking on your project. I am an experienced developer with a diploma in the field of web development. I have been working in the field of web development for roughly 7 years. I take great pride in my work and deliver only the best quality. My skill-set includes... -PHP -HTML5 -CSS -Responsive Design -Wordpress I look forward to hearing from you and hopefully we will have the opportunity to work together. Thank you, Meagan S.
$34 AUD en 1 día
4,7 (21 comentarios)
4,0
4,0
Avatar del usuario
A proposal has not yet been provided
$15 AUD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de AUSTRALIA
Broadway, Australia
5,0
28
Forma de pago verificada
Miembro desde oct 20, 2011

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.