Post
Topic
Board Micro Earnings
Re: [ANN] Microwallet.org - API + free faucet script, start your own faucet!
by
BitcoinFuture99
on 06/11/2014, 09:21:22 UTC
please post some useful discussion about Microwallet having Issues regarding IP and API
 

This is the only temp fix I know, but it should work.

Balance Fix:
Replace:
Code:
$balance = @file_get_contents('https://www.microwallet.org/api/v1/balance?api_key=' . rawurlencode($GLOBALS['settings']['microwallet_api_key']));

With...
Code:
   $balance = @file_get_contents('https://www.microwallet.org/api/v1/balance?api_key=' . rawurlencode($GLOBALS['settings']['microwallet_api_key']));
            $request = '';
            $request .= "GET /api/v1/balance?api_key=".rawurlencode($GLOBALS['settings']['microwallet_api_key'])." HTTP/1.0\r\n";
            $request .= "Host: www.microwallet.org\r\n";
            $request .= "Connection: close\r\n\r\n";
            $fp = @fsockopen('ssl://104.28.0.112', 443);
            if (!$fp) {
              // ??
            }
            @fputs($fp, $request);
            $response = '';
            while (!@feof($fp)) {
                $response .= @fgets($fp, 1024);
            }
            @fclose($fp);
            $balance = explode("\r\n\r\n", $response);
            $balance = $balance[1];

Failure to Send Fix:
Replace:
Code:
$fp = @fsockopen('ssl://www.microwallet.org', 443);
        if (!$fp) {
            return array(
                'success' => false,
                'message' => 'Failed to send.',
                'html' => '
Failed to send.
',
                'response' => null,
            );

With...
Code:
$fp = @fsockopen('ssl://'.gethostbyname('www.microwallet.org'), 443);
        if (!$fp) {
            return array(
                'success' => false,
                'message' => 'Failed to send.',
                'html' => '
Failed to send.
',
                'response' => null,
            );



Thanks for Posting the whole story

But for me the actual IP of Microwallet works. Not the one you mentioning or the method of
$fp = @fsockopen('ssl://'.gethostbyname('www.microwallet.org'), 443);

nothing works. Also It only works for me with PHP 5.4 version and with others it shows fail to send.