Pages:
Author

Topic: FaucetHub.io - BETA! Prepare your bodies. - page 4. (Read 6622 times)

legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 25, 2016, 04:49:46 PM
#46
You had to, didn't you?! Cheesy
Now i'm stuck listening it.

Done, please check it out Smiley

Awesome!!! I'm merging it back. One sore note, though, and I feel really really stupid, as the patch missed that change:

Code:
-        $fp = fopen($this->api_base . $method, 'rb', null, $ctx);
+        $fp = @fopen($this->api_base . $method, 'rb', null, $ctx);
...
-        $response = json_decode($response, true);
+        $response = @json_decode($response, true);

those two adjustments really are needed.

I know you probably have an aversion to error-silencing "feature" of PHP, but as both those functions emit Warnings in addition to returning null when something goes wrong, it's the way to go. Plus we check the return values as soon as possible, it's fine really.

Sorry again for wasting your time with incomplete patch Sad

BTW, http://faucethub.io/phplib lists "PDO module for PHP" and "PDO compatible database and PHP driver" under Requirements. As you know, those aren't really used in the bare lib. You could also downgrade "cURL PHP module" to "Optional/Recommended" while you're at it.



Still waiting for an ability to link multiple addresses into single account and to get my hands on those precious -FAKE- DOGE coins. Burning with excitement, even! Smiley
Working on multi addy feature. I'm really against this, but if it's gonna help you guys, then it's fine. (Sad_face.png)

Suppressing of errors is a bad thing to have, and that error handling is something thats very much down to the server environment and php configuration Sad

Can you please test with BTC for now, instead of DOGE? (Or you have only the ability to test DOGE?)
legendary
Activity: 1120
Merit: 1000
https://cryptoworld.io
hero member
Activity: 622
Merit: 500
SatoshiGalaxy
November 25, 2016, 02:11:45 PM
#44
Done, please check it out :)

Awesome!!! I'm merging it back. One sore note, though, and I feel really really stupid, as the patch missed that change:

Code:
-        $fp = fopen($this->api_base . $method, 'rb', null, $ctx);
+        $fp = @fopen($this->api_base . $method, 'rb', null, $ctx);
...
-        $response = json_decode($response, true);
+        $response = @json_decode($response, true);

those two adjustments really are needed.

I know you probably have an aversion to error-silencing "feature" of PHP, but as both those functions emit Warnings in addition to returning null when something goes wrong, it's the way to go. Plus we check the return values as soon as possible, it's fine really.

Sorry again for wasting your time with incomplete patch :(

BTW, http://faucethub.io/phplib lists "PDO module for PHP" and "PDO compatible database and PHP driver" under Requirements. As you know, those aren't really used in the bare lib. You could also downgrade "cURL PHP module" to "Optional/Recommended" while you're at it.



Still waiting for an ability to link multiple addresses into single account and to get my hands on those precious -FAKE- DOGE coins. Burning with excitement, even! :)
legendary
Activity: 971
Merit: 1000
November 25, 2016, 01:31:13 PM
#43
Invalid Bitcoin Address
The address entered is not a valid Bitcoin address

For xapo addresses . Will this be fixed?
I'll see what I can do.

I'm not really a fan of XAPO. I consider it more like a bank, than a wallet.
Bitcoin's philosophy is against such things. Bitcoin requires anonymity ;p

The problem is fixable , you just need to let the faucet accept multi sig addresses that start with 3

Not only Xapo uses P2SH (https://en.bitcoin.it/wiki/Pay_to_script_hash) addresses. Many wallets do and it's a great way to increase security of coins.
There are also P2SH addresses for other currencies. However note that P2SH addresses for Bitcoin and Litecoin are indistinguishable, which means that a valid Bitcoin P2SH address is also valid Litecoin P2SH address. If you expect that address itself can be used as a unique qualifier, that may be problematic.
hero member
Activity: 504
Merit: 501
November 25, 2016, 01:27:29 PM
#42
Invalid Bitcoin Address
The address entered is not a valid Bitcoin address

For xapo addresses . Will this be fixed?
I'll see what I can do.

I'm not really a fan of XAPO. I consider it more like a bank, than a wallet.
Bitcoin's philosophy is against such things. Bitcoin requires anonymity ;p

The problem is fixable , you just need to let the faucet accept multi sig addresses that start with 3
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 25, 2016, 12:24:17 PM
#41
Hey, so implementing FaucetHUB over here,

first of all, could you please merge this patch?
Code:
-snip-
-- because if it failed, it failed, magical silent retry with another method is evil -- controversial
etc

Feel free to ignore the code, but please do tend to the problems it solves. And of course, ask me anything if it needs any clarifications.



Next up, I've signed up with AddressA. Now I'm trying to withdraw to AddressB, and FH suggests I link it to my account on address check page.

(Honestly, this whole "signup before use" is not something I like at all, but I'll post at another thread to keep this one clean)

But, anyways, as I try to link the address, by clicking the buton, I just get redirected to my dashboard... And it looks like there is no option to link currently? I see my original AddressA there, with no ability to change it. Game over?



And the most important question of all: where do I get 'em sweet fake coins?

Done, please check it out Smiley
hero member
Activity: 622
Merit: 500
SatoshiGalaxy
November 25, 2016, 05:52:06 AM
#40
Hey, so implementing FaucetHUB over here,

first of all, could you please merge this patch?
Code:
--- faucethub-orig.php 2016-11-25 09:21:04.000000000 +0400
+++ faucethub.php 2016-11-25 13:40:06.742170900 +0400
@@ -18,15 +18,26 @@
 {
     protected $api_key;
     protected $currency;
+    protected $timeout;
     public $last_status = null;
     protected $api_base = "https://faucethub.io/api/v1/";
 
-    public function __construct($api_key, $currency = "BTC", $disable_curl = false, $verify_peer = true) {
+    public function __construct($api_key, $currency = "BTC", $disable_curl = false, $verify_peer = true, $timeout = null) {
         $this->api_key = $api_key;
         $this->currency = $currency;
         $this->disable_curl = $disable_curl;
         $this->verify_peer = $verify_peer;
         $this->curl_warning = false;
+        $this->setTimeout($timeout);
+    }
+
+    public function setTimeout($timeout) {
+        if($timeout === null) {
+            $socket_timeout = ini_get('default_socket_timeout');
+            $script_timeout = ini_get('max_execution_time');
+            $timeout = min($script_timeout / 2, $socket_timeout);
+        }
+        $this->timeout = $timeout;
     }
 
     public function __execPHP($method, $params = array()) {
@@ -35,7 +46,8 @@
             "http" => array(
                 "method" => "POST",
                 "header" => "Content-type: application/x-www-form-urlencoded\r\n",
-                "content" => http_build_query($params)
+                "content" => http_build_query($params),
+                "timeout" => $this->timeout,
             ),
             "ssl" => array(
                 "verify_peer" => $this->verify_peer
@@ -43,6 +55,12 @@
         );
         $ctx = stream_context_create($opts);
         $fp = fopen($this->api_base . $method, 'rb', null, $ctx);
+        if (!$fp) {
+            return array(
+                'status' => 503,
+                'message' => 'Connection error',
+            );
+        }
         $response = stream_get_contents($fp);
         if($response && !$this->disable_curl) {
             $this->curl_warning = true;
@@ -58,11 +76,18 @@
         } else {
             $response = $this->__execCURL($method, $params);
         }
-        $response = json_decode($response, true);
+        if(is_array($response)) { //connection error
+            return $response;
+        }
+        $response = @json_decode($response, true);
         if($response) {
             $this->last_status = $response['status'];
         } else {
             $this->last_status = null;
+            $response = array(
+                'status' => 502,
+                'message' => 'Invalid response',
+            );
         }
         return $response;
     }
@@ -75,10 +100,14 @@
         curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+        curl_setopt($ch, CURLOPT_TIMEOUT, (int)$this->timeout);
 
         $response = curl_exec($ch);
         if(!$response) {
-            $response = $this->__execPHP($method, $params);
+            return array(
+                'status' => 504,
+                'message' => 'Connection error',
+            );
         }
         curl_close($ch);
 
@@ -86,6 +115,8 @@
     }
 
     public function send($to, $amount, $referral = "false", $ip_address = "") {
+        if ($referral === false) $referral = 'false';
+        if ($referral === true) $referral = 'true';
         $r = $this->__exec("send", array("to" => $to, "amount" => $amount, "referral" => $referral, "ip_address" => $ip_address));
         if (array_key_exists("status", $r) && $r["status"] == 200) {
             return array(

here's the super-long explanation of what it does https://bitcointalksearch.org/topic/m.13080814

TL;DR version is that it
adds timeout checks -- good
adds proper handling of connection errors and wrong responses -- good
does that by adding fake error codes -- bad, please review
does this thing
Code:
        $response = curl_exec($ch);
         if(!$response) {
-            $response = $this->__execPHP($method, $params);
-- because if it failed, it failed, magical silent retry with another method is evil -- controversial
etc

Feel free to ignore the code, but please do tend to the problems it solves. And of course, ask me anything if it needs any clarifications.



Next up, I've signed up with AddressA. Now I'm trying to withdraw to AddressB, and FH suggests I link it to my account on address check page.

(Honestly, this whole "signup before use" is not something I like at all, but I'll post at another thread to keep this one clean)

But, anyways, as I try to link the address, by clicking the buton, I just get redirected to my dashboard... And it looks like there is no option to link currently? I see my original AddressA there, with no ability to change it. Game over?



And the most important question of all: where do I get 'em sweet fake coins?
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 25, 2016, 05:47:17 AM
#39
Invalid Bitcoin Address
The address entered is not a valid Bitcoin address

For xapo addresses . Will this be fixed?
I'll see what I can do.

I'm not really a fan of XAPO. I consider it more like a bank, than a wallet.
Bitcoin's philosophy is against such things. Bitcoin requires anonymity ;p
full member
Activity: 210
Merit: 100
★Spacey The Bird★ Android Game , Bitco
November 25, 2016, 05:10:45 AM
#38
Invalid Bitcoin Address
The address entered is not a valid Bitcoin address

For xapo addresses . Will this be fixed?
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 25, 2016, 03:08:54 AM
#37
Very impressive, what are your fees? The website looks promising . Are you going to add faucet scripts to download or just going to migrate from Faucetbox scripts? I will be watching this thread for when you are through with Beta to test out your system. Good luck with your site.
Standard fee is 1.5%. Wont be higher or lower in the future.
Yes, there's going to be a custom made script made by me from scratch, just, I don't know when. Might take 1 month, or two. Not quite sure, since I wasn't planning to work on this microwallet project, until I heard the news about faucetbox.
I was planning to launch my adnet until end of the year.

Thanks man, appreciate it Smiley
hero member
Activity: 504
Merit: 501
November 25, 2016, 03:01:47 AM
#36
Very impressive, what are your fees? The website looks promising . Are you going to add faucet scripts to download or just going to migrate from Faucetbox scripts? I will be watching this thread for when you are through with Beta to test out your system. Good luck with your site.
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 25, 2016, 02:46:04 AM
#35
It's not a big problem but if I choose russian room chat and than go to statistic menu (or any else) chat room returns to English
Well, the majority of the site users speaks English, it's normal, heh

Nice, I'm just waiting the FaucetBox script mofidicated to try starting a faucet in FaucetHub, I already have everything needed, but it's on FaucetBox yet.

I don't understand very well how to do it... So, better to wait the easily way be ready.
I'm sure there's people willing to help you figure it out. It's very simple.
You can use any script you want, you just need to make sure APIs are used correctly Smiley


The site looks awesome Mex going to have a look around also Good job on creating ya own Micropayment site Smiley
Thanks Josh!
member
Activity: 95
Merit: 10
November 25, 2016, 02:30:34 AM
#34
It's not a big problem but if I choose russian room chat and than go to statistic menu (or any else) chat room returns to English
hero member
Activity: 1190
Merit: 525
CryptoTalk.Org - Get Paid for every Post!
November 24, 2016, 10:40:30 PM
#33
Nice, I'm just waiting the FaucetBox script mofidicated to try starting a faucet in FaucetHub, I already have everything needed, but it's on FaucetBox yet.

I don't understand very well how to do it... So, better to wait the easily way be ready.
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 24, 2016, 09:33:10 PM
#32
I can't confirm my account. I didn't received confirmation email message (I checked spam folder).
Can you PM me your e-mail?
Thanks

EDIT: From what I see in the system, you've clicked on the link and your account is active now?
Yes, everything is fine now. I received email a bit later than I expected.
Glad it worked Smiley

Guess that's it for today. I'm going to chill for now.

If you have any issues/questions, please post in this thread and I'll answer to everything tomorrow when I wake up.

Thanks
legendary
Activity: 3080
Merit: 1338
Slava Ukraini!
November 24, 2016, 09:00:27 PM
#31
I can't confirm my account. I didn't received confirmation email message (I checked spam folder).
Can you PM me your e-mail?
Thanks

EDIT: From what I see in the system, you've clicked on the link and your account is active now?
Yes, everything is fine now. I received email a bit later than I expected.
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 24, 2016, 08:54:00 PM
#30
I can't confirm my account. I didn't received confirmation email message (I checked spam folder).
Can you PM me your e-mail?
Thanks

EDIT: From what I see in the system, you've clicked on the link and your account is active now?
legendary
Activity: 3080
Merit: 1338
Slava Ukraini!
November 24, 2016, 08:45:15 PM
#29
I can't confirm my account. I didn't received confirmation email message (I checked spam folder).
legendary
Activity: 1652
Merit: 1043
Cypherpunk (& cyberpunk)
November 24, 2016, 08:22:56 PM
#28
Create faucet isn'T working yet??
I get a message saying " a faucet already exist with this name'

EDIT: i get this error if i leave url field blank only - FIXED
EDIT 2: I can set timer and payout amount to negative numbers (Same thing with rate limits) FIXED

TODO:

Need a confirmation window  when i delete faucet .. because now i can delete with 1 click

EDIT:

Fixed all.

Keep em coming folks

Great work, mex Smiley

Thanks Smiley

All reported bugs have been fixed, even those which were reported in chatbox.

sr. member
Activity: 306
Merit: 250
For Sell
November 24, 2016, 08:01:43 PM
#27
Create faucet isn'T working yet??
I get a message saying " a faucet already exist with this name'

EDIT: i get this error if i leave url field blank only - FIXED
EDIT 2: I can set timer and payout amount to negative numbers (Same thing with rate limits) FIXED

TODO:

Need a confirmation window  when i delete faucet .. because now i can delete with 1 click

EDIT:

Fixed all.

Keep em coming folks

Great work, mex Smiley
Pages:
Jump to: