Bitcoin Forum
February 09, 2026, 03:25:46 PM *
News: Community awards 2025
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Economy / Marketplace / Re: Get bitcoins for free and be happy. on: September 05, 2012, 10:33:23 AM
Hehe bitcats  Cool
2  Economy / Marketplace / Re: Get bitcoins for free and be happy. on: September 04, 2012, 06:36:11 PM
Thank you bitcats it worked! But why don't you set another word now that everyone knows it?
3  Bitcoin / Project Development / Re: [ANNOUNCE] Open source MtGOX PHP API Class on: June 07, 2012, 03:32:16 PM
...

Thank you soooo much!

 Grin  Grin  Grin

I am gonna try this little piece of code Smiley

I suppose that this file should be adapted with some specific informations, as I saw a kind of PGP encoding inside?

 Tongue
4  Bitcoin / Project Development / Re: [ANNOUNCE] Open source MtGOX PHP API Class on: June 07, 2012, 08:50:51 AM
Okay I was able to fix the first set of errors by putting

Quote
<?php

class MtGox_API
{

    function __construct($key="sdsfdfyssfd-sfdsdf-dsfdfds-fdsdfsfds-fddfsfsd", $secret="fdsgfgffftgrgretzt3355353tet5trr5353")
    ...

bu I then still get

Quote
Fatal error: Uncaught exception 'Exception' with message 'Could not get reply: error setting certificate verify locations: CAfile: ABSPATH/cert/facacbc6.0 CApath: none ' in myserver.com/json.php:42 Stack trace: #0 myserver.com/json.php(187): MtGox_API->query('0/btcAddress.ph...') #1 myserver.com/json.php(213): MtGox_API->get_btc_address() #2 {main} thrown in myserver.com/json.php on line 42

What is wrong there?

Could some1 point me to the solution  Huh Help !
5  Local / Discussions générales et utilisation du Bitcoin / Re: PirateBox et Bitcoin on: June 07, 2012, 08:21:34 AM
je te MP dès que c'est bon  Smiley
6  Bitcoin / Project Development / Re: [ANNOUNCE] Open source MtGOX PHP API Class on: June 07, 2012, 08:10:11 AM
BCB, thank you very much... I have never been so close  Grin

But I please you to pardon my noobness : may I ask you what is incorrect in my code?

The following, modified as you told me :

Quote
<?php

define('MTGOX_KEY' , 'sdsfdfyssfd-sfdsdf-dsfdfds-fdsdfsfds-fddfsfsd');
define('MTGOX_SECRET', 'fdsgfgffftgrgretzt3355353tet5trr5353');

class MtGox_API
{

    function __construct($key, $secret)
    {
        $this->key = MTGOX_KEY;
        $this->secret = MTGOX_SECRET;
    }

    function query($path, array $req = array())
    {
        // generate a nonce as microtime, with as-string handling 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, '', 'name=sandy67&pass=lovebitcoins84');
 
        // generate the extra headers
        $headers = array('Rest-Key: ' . $this->key,
                         'Rest-Sign: '. base64_encode(hash_hmac('sha512', $post_data, base64_decode($this->secret), true)));
 
        // 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; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');
        }
        curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/' . $path);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_CAINFO, ABSPATH . "/cert/facacbc6.0");
 
        // run the query
        $res = curl_exec($ch);
        if ($res === false) throw new Exception('Could not get reply: ' . curl_error($ch));
        $dec = json_decode($res, true);
        if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists');
        return $dec;
    }

    function get_info()
    {
        return self::query('0/info.php');
    }
   
    ////////////////////////////////////////////////////////////////////////
    // * 0/getFunds.php
    //
    // Get your current balance
    //
    // https://mtgox.com/api/0/getFunds.php
    ////////////////////////////////////////////////////////////////////////

    function get_funds()
    {
        return self::query('0/getFunds.php');
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/buyBTC.php
    //
    // Place an order to Buy BTC
    //
    // POST data: amount=#&price=#
    //
    // returns a list of your open orders
    ////////////////////////////////////////////////////////////////////////

    function buy_btc($amount, $price)
    {
        return self::query('0/buyBTC.php',
                           array('amount' => $amount,
                                 'price' => $price));
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/sellBTC.php
    //
    // Place an order to Sell BTC
    //
    // POST data: &amount=#&price=#
    //
    // returns a list of your open orders
    ////////////////////////////////////////////////////////////////////////

    function sell_btc($amount, $price)
    {
        return self::query('0/sellBTC.php',
                           array('amount' => $amount,
                                 'price' => $price));
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/getOrders.php
    //
    // Fetch a list of your open Orders
    //
    // returned type: 1 for sell order or 2 for buy order
    //
    // status: 1 for active, 2 for not enough funds
    ////////////////////////////////////////////////////////////////////////

    function get_orders()
    {
        return self::query('0/getOrders.php');
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/cancelOrder.php
    //
    // Cancel an order
    //
    // POST data: oid=#&type=#
    //
    // oid: Order ID
    ////////////////////////////////////////////////////////////////////////

    function cancel_order($orderid)
    {
        return self::query('0/cancelOrder.php',
                           array('oid' => $orderid));
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/redeemCode.php
    //
    // Used to redeem a mtgox coupon code
    //
    // call with a post parameter "code" containing the code to redeem
    //
    // it will return an array with amount (float amount value of code), currency (3 letters, BTC or USD), reference (the transaction id), and status
    //
    ////////////////////////////////////////////////////////////////////////

    function deposit_coupon($code)
    {
        return self::query('0/redeemCode.php',
                           array('code' => $code));
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/withdraw.php
    //
    // withdraw / Send BTC
    //
    // POST data: group1=BTC&btca=bitcoin_address_to_send_to&amount=#
    //
    // pass btca parameter to withdraw to a btc adress
    // pass group1 for a coupon : BTC2CODE or USD2CODE
    // pass group1=DWUSD for a dwolla withdraw
    //
    // return code and status if successful
    ////////////////////////////////////////////////////////////////////////

    function withdraw_btc_coupon($amount)
    {
        return self::query('0/withdraw.php',
                           array('group1' => 'BTC2CODE',
                                 'amount' => $amount));
    }

    function withdraw_fiat_coupon($amount, $currency = CURRENCY)
    {
        return self::query('0/withdraw.php',
                           array('group1' => 'USD2CODE',
                                 'amount' => $amount,
                                 'Currency' => $currency)); // has to have capital 'C'; $currency = 'AUD' works
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/btcAddress.php
    //
    // get a bitcoin deposit adress for your account
    //
    // returns a bitcoin deposit address
    ////////////////////////////////////////////////////////////////////////

    function get_btc_address()
    {
        return self::query('0/btcAddress.php');
    }

    ////////////////////////////////////////////////////////////////////////
    // * 0/history_[CUR].csv
    //
    // Allows downloading your activity history for a given currency (BTC or USD for now).
    //
    // https://mtgox.com/api/0/history_BTC.php
    // https://mtgox.com/api/0/history_USD.php
    ////////////////////////////////////////////////////////////////////////

    function get_btc_history()
    {
        return self::query('0/history_BTC.csv'); /* doesn't work */
    }

    function get_usd_history()
    {
        return self::query('0/history_USD.csv'); /* doesn't work */
    }
}


$inst = new MtGox_API();

echo '<pre>' . print_r($inst->get_funds(),true) . '</pre>';

?>

... I got the following errors :

Quote
Warning: Missing argument 1 for MtGox_API::__construct(), called in myserver.com/json.php on line 211 and defined in myserver.com/json.php on line 9

Warning: Missing argument 2 for MtGox_API::__construct(), called in myserver.com/json.php on line 211 and defined in myserver.com/json.php on line 9

Fatal error: Uncaught exception 'Exception' with message 'Could not get reply: error setting certificate verify locations: CAfile: ABSPATH/cert/facacbc6.0 CApath: none ' in myserver.com/json.php:42 Stack trace: #0 myserver.com/json.php(63): MtGox_API->query('0/getFunds.php') #1 myserver.com/json.php(213): MtGox_API->get_funds() #2 {main} thrown in myserver.com/json.php on line 42

A thousand thanks  Tongue
7  Bitcoin / Project Development / Re: [ANNOUNCE] Open source MtGOX PHP API Class on: June 07, 2012, 02:11:09 AM
dooglus, how may I execute the functions?

For example there is the function get_funds(), but how and where may I execute it?

Sorry for my dumb questions  Undecided
8  Local / Discussions générales et utilisation du Bitcoin / Re: La plus grande arnaque financière de tout les temps! on: June 06, 2012, 04:29:28 PM
oui ces videos sont edifiantes... on s'est vraiment fait avoir (pendant un moment)...

Maintenant, place aux Bitcoins Smiley
9  Local / Discussions générales et utilisation du Bitcoin / Re: PirateBox et Bitcoin on: June 06, 2012, 04:28:15 PM
pharaon > mp done Smiley
10  Bitcoin / Bitcoin Technical Support / Re: Blockchain.info HTTP JSON String for Payement notifications on: June 06, 2012, 01:04:35 PM
Quote
BlockExplorer and Blockchain.info are nowhere near ready reliable enough to use as a blockchain database tool for used in ecommerce

Undecided

Okay...

Thank you very much!
11  Other / Beginners & Help / Re: Websites to Earn Bitcoins on: June 05, 2012, 04:56:39 PM
SerenaL you rock  Tongue

Thank you  Cool
12  Bitcoin / Bitcoin Technical Support / Re: Blockchain.info HTTP JSON String for Payement notifications on: June 05, 2012, 03:30:34 PM
But if I have to run bitcoin daemon, this would mean that I would be headed to an online wallet?

Here is what I would like to do:

A user orders smthg on the website, then gets:
'Here is your wallet adress for the payement : 333hghgksuzwzarat678ajhsgjsjs8'

> This adress is recorded in my database in an 'wallet' field, and next to it, a 'verif' field.

Then, a cron job is runned, checking if this adress has been credited, and if yes, the cron job changes the value of the 'verif' field.

Isn't there a way to achieve this without all the bitcoin setup?

Thanks in advance!
13  Local / Discussions générales et utilisation du Bitcoin / Re: PirateBox et Bitcoin on: June 05, 2012, 03:24:36 PM
Ben oui c'est vrai que si tu la fais toi-même c'est moins cher^^ J'encourage! Le link vers le tuto piratebox est sur notre page!

Nous faisons ouvertement la promotion de la piratebox et encourageons vivement toute personne à s'intéresser à ce concept et à construire sa propre box. On a juste fait une version avec un coeur à la place d'une tête de mort Wink

Du coup, ce que nous proposons pour 150euros c'est une box déjà montée, les frais de shipping sont inclus et nous faisons un package un peu spécial... design custom!

Les bénéfices d'une vente nous permettent TOUT JUSTE d'en produire une autre et c'est uniquement à cela que ça sert^^

Pratiquement, l'achat d'une freelovebox permet à une autre de voir le jour!

Ce, afin d'assurer la continuité  Wink
14  Bitcoin / Bitcoin Technical Support / Blockchain.info HTTP JSON String for Payement notifications on: June 05, 2012, 10:14:12 AM
Hi Bitcoin fans Smiley

I am currently building a website with PHP/SQL to sell products in Bitcoins (Nice Swiss stuff...watch out!) and am willing to verify if an amount has been sent to a bitcoin adress I provide when submitting a form.

I have to list the adresses which contains Bitcoins along with their payement status(show amount if verified), so I am looking for the simplest way of doing this.

I found out this piece of code, regarding blockexplorer:

Quote
$Awallets = $row['wallet'];
$Live_Address_Scan = "http://blockexplorer.com/q/getreceivedbyaddress/$Awallets";
$ch = curl_init($Live_Address_Scan);
curl_setopt($ch, CURLOPT_REFERER, 'Mozilla/5.0 (compatible; GetReceivedBy; '.php_uname('s').'; PHP/'.phpversion().')');
curl_setopt($ch, CURLOPT_USERAGENT, "CakeScript/0.1");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$Donated_Bitcoins = curl_exec($ch);
curl_close($ch);

But eventually there are some 'moments' where blockexplorer cannot be sollicited so an error message shows up in the field where the amount should appear  Embarrassed

'Database overload...'

I then came up about blockchain and I have to use this specific code:

Quote
HTTP Post

A HTTP POST request will be made on payment sent or received to URL provided on your My Account page. The POST body will contain one "payload" variable which contains JSON data about the transaction. Any effect on your wallet will need to be calculated by your server.

e.g. Access JSON using php

$_POST['payload']

{
    "hash": "bf8648b06160ded3274d6054cfeadd95f762271170070429ef40d62ac5452c4b",
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 2,
    "lock_time": "Unavailable",
    "size": 258,
    "relayed_by": "71.238.174.98",
    "tx_index": 13903761,
    "time": 1325700693,
    "inputs": [
        {
            "prev_out": {
                "hash": "e417eb0889a1870e6b500ad8769cb7110739749e",
                "addr": "1Mo3ibZuqZpsBGimyfmUnYDiZoU44VbAJV",
                "value": 438000000,
                "tx_index": 13902462,
                "n": 1
            }
        }
    ],
    "out": [
        {
            "value": 215000000,
            "hash": "6c835372a306b2e253f896801cb0b5703d60114c",
            "addr": "1AtmJQYUCVZSwoLkQvEvFhtoRfwn4Eumuu"
        },
        {
            "value": 222000000,
            "hash": "60ce49cd97aa152e1db8a76c1b62c55ae3b059d3",
            "addr": "19przaW7NeE96SEVtKGWdGM3CuKVaSYhrS"
        }
    ]
}
         

As a rudimentary form of verification the HTTP server should respond by printing the user's wallet identifier.

echo '0aef6e46-2422-6d4c-772c-bacccf378b6b';


I managed to have a recognized listener adress along with the echo 'wallet', but then, how do I parse this JSON string? May I ask if someone could point me to the right direction or even show me some code? I do not know how to 'begin', like is it in a <?php tag or something different?

A thousands thanks in advance,

 Smiley
15  Local / Discussions générales et utilisation du Bitcoin / Re: PirateBox et Bitcoin on: June 05, 2012, 07:04:34 AM
Du coup pharaon je veux bien te passer 2-3 fichiers pour que tu les poses sur ta box Smiley

Si je t'envoie de la musique, tu la partages?

Tu peux m'en envoyer aussi et je les mettrai sur la/les mienne Smiley
16  Local / Discussions générales et utilisation du Bitcoin / Re: PirateBox et Bitcoin on: June 05, 2012, 07:02:43 AM
http://www.freelovebox.com

 Grin  Cheesy  Cool

Des box déjà montées, disponibles en bitcoins (sur demande!), pour ceux qui n'ont pas la possibilité de les monter eux-même (un peu de bidouille sous linux et quelques pièces hardware à se procurer et assembler)...

Basé sur la piratebox :
http://wiki.daviddarts.com/PirateBox

Une fois branchée (secteur ou battery pack), la box émet un wifi; dans la box est plantée une clés usb sur laquelle vous mettez vos fichiers à partager, et qui sont dispo via ce wifi. Il y a même un chat!

Totalement anonyme! Vous vous posez au bistro avec votre box dans le sac et vous partagez vos fichiers n'importe où  Smiley

Pas besoin d'"abonnement internet" ou quoi que ce soit pour avoir son propre réseau!

Et avec le protocole Batman, il y a la possibilité de les connecter entre elles pour former un plus grand réseau... WHoa...

Hadopi n'a qu'à bien se tenir...

D'autre liens :

piratebox.c.la/
korben.info/tuto-piratebox.html
mypiratebox.com/

17  Local / Italiano (Italian) / Re: Salve a tutti on: June 03, 2012, 10:14:49 AM
Smiley
18  Local / Italiano (Italian) / Re: News in Italiano - Raccolta di link dei media in lingua italiana on: June 01, 2012, 03:00:13 PM
Grande  Grin

Italiani Bitcoins ^^^
19  Bitcoin / Bitcoin Discussion / Re: What to call 0.001 BTC? (5 BTC Bounty) on: May 31, 2012, 09:57:56 PM
'Hey man.. got any S-Coin?!'

 Tongue
20  Economy / Marketplace / Re: 3 free BTC to someone who comes up with a slogan I like on: May 27, 2012, 11:34:51 PM
First, some free love for all :
Kiss Kiss KissKiss Kiss KissKiss Kiss Kiss



Then, some other propositions :

"Connect the dots"

"Join the dots"

Join our Database Smiley

Do the link !


Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!