Bitcoin Forum
April 26, 2024, 07:09:44 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Add-on for FaucetBOX Script: Rewards will be changed with Bitcoin price (Auto)  (Read 2190 times)
alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 22, 2017, 04:34:35 PM
 #1

Price of Bitcoin changes everyday. So, faucet owners need to keep a balance between bitcoin price and faucet rewards because profit from ad networks depends on bitcoin price. So, I have written a few codes that will change faucet rewards as bitcoin price goes.
[Note: That's for faucetBOX script]

1. Open: /libs/service.php file
Find:
Code:
public function send($to, $amount, $userip, $referral = "false") {
Add after:
Code:
        if($this->currency === "BTC") {
        $get_rate = file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1");
        $rate_sats = $get_rate * 100000000;
        $amount = intval($amount * $rate_sats);
        }

2. Create a file named rs.php

Add these codes into it:
Code:
<?php
     $get_rate 
file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1");
     
$rate $get_rate 100000000;
     
$reward1 intval($rate 0.001); // your first reward in USD
     
$reward2 intval($rate 0.0025); // your second reward in USD
     
$reward3 intval($rate 0.005); // your third reward in USD
     
echo "$reward1 , $reward2 , $reward3";
?>

Note: This file is just for showing faucet rewards. If you want to add more rewards, add like this:
Code:
$reward4 = intval($rate * 0.004);
$reward5 = intval($rate * 0.005);
$reward6 = intval($rate * 0.006);
Just replace 0.004, 0.005, 0.006 with your own numbers. Don't touch other things.
Then just add these $reward4 , $reward5 , $reward6 inside echo "";
Example:
Code:
echo "$reward1 , $reward2 , $reward3, $reward4 , $reward5 , $reward6 ";
Now upload this file anywhere and get the URL.

3. Then open /templates/default/index.php
Find:
Code:
<?php echo $data["rewards"]; ?>
Replace with:
Code:
<?php $show_rewards file_get_contents("http://example.com/rs.php"); echo "$show_rewards"?>
Note: Replace http://example.com/rs.php with your rs.php file's URL.

4. After completing this part, go to admin panel and put rewards as USD value. Example: 0.001 for 100 satoshi.
That's it. Now everything is complete! Rewards of your faucet will be changed automatically according to bitcoin price, you won't have to worry. Smiley
1714158584
Hero Member
*
Offline Offline

Posts: 1714158584

View Profile Personal Message (Offline)

Ignore
1714158584
Reply with quote  #2

1714158584
Report to moderator
1714158584
Hero Member
*
Offline Offline

Posts: 1714158584

View Profile Personal Message (Offline)

Ignore
1714158584
Reply with quote  #2

1714158584
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714158584
Hero Member
*
Offline Offline

Posts: 1714158584

View Profile Personal Message (Offline)

Ignore
1714158584
Reply with quote  #2

1714158584
Report to moderator
bitcoinniels
Full Member
***
Offline Offline

Activity: 354
Merit: 106


View Profile
March 22, 2017, 04:44:14 PM
 #2

This is very good, i dont use faucethub script.
But i think alot of people which do use it (alot) will be very thankful for this.

Great job! Grin

Bytecoiner419
Hero Member
*****
Offline Offline

Activity: 637
Merit: 511


I ❤ the bitcoin community


View Profile WWW
March 22, 2017, 04:46:09 PM
 #3

wow great work!

Thanks for helping us faucet owners with this great new tool.

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
🏆BitcoinsBest.Com🏆 👉 Buy Ad Space, LIVE BTC Casino & Crypto Articles 🌟
alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 22, 2017, 06:29:09 PM
 #4

This is very good, i dont use faucethub script.
But i think alot of people which do use it (alot) will be very thankful for this.

Great job! Grin
thank you. But perhaps you can add this feature into your script too. Smiley

wow great work!

Thanks for helping us faucet owners with this great new tool.
You're most welcome and thank you. See this also for your dice script: https://bitcointalk.org/index.php?topic=1838418.0 Smiley

Well this is Good Ive put it on   http://faucetmega.com
 So its all working fine Smiley
just need some reward changing then it will work as planned Smiley

Great Job

WoW...! Thank you for testing it on your site. Smiley
bitcoinniels
Full Member
***
Offline Offline

Activity: 354
Merit: 106


View Profile
March 22, 2017, 06:32:40 PM
 #5

This is very good, i dont use faucethub script.
But i think alot of people which do use it (alot) will be very thankful for this.

Great job! Grin
thank you. But perhaps you can add this feature into your script too. Smiley

wow great work!

Thanks for helping us faucet owners with this great new tool.
You're most welcome and thank you. See this also for your dice script: https://bitcointalk.org/index.php?topic=1838418.0 Smiley

Well this is Good Ive put it on   http://faucetmega.com
 So its all working fine Smiley
just need some reward changing then it will work as planned Smiley

Great Job

WoW...! Thank you for testing it on your site. Smiley

I'll ask the developer, but since were both still in school.
We both dont have alot of time, but ill ask if he can do it!

Thanks for making it again Cheesy

felicita
Legendary
*
Offline Offline

Activity: 1582
Merit: 1031



View Profile
March 22, 2017, 07:53:09 PM
Last edit: March 22, 2017, 10:32:07 PM by felicita
 #6

thanks was really easy to implement this in my script (not faucetbox)


now i have a mind. and max. reward depending on the Bitcoin Kurse and payout is a random number , thanks !!

Code:
$get_rate 		= file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1") * 100000000;
$payOut   = rand(intval($get_rate * 0.004), intval($get_rate * 0.002));
$payOutBTC   = $payOut / 100000000;


kind regards
CasinoBetGame
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
March 22, 2017, 10:55:20 PM
 #7

youre script orginal faucetbox
because faucetbox.com is closed service
LTU_btc
Legendary
*
Online Online

Activity: 3038
Merit: 1330


Slava Ukraini!


View Profile WWW
March 23, 2017, 12:05:08 AM
 #8

Wow, I think many faucet owners wanted for such add-on to set rewards based on USD value. As I understand, this addon in general works in same way like freebitco.in where rewards are alway s same value in USD.
youre script orginal faucetbox
because faucetbox.com is closed service
Yeah, Faucetbox is closed service but their faucet script is still very popular and used on many Faucethub, ePay and some Faucetsystem faucets

Gregc1131
Full Member
***
Offline Offline

Activity: 223
Merit: 103



View Profile WWW
March 23, 2017, 10:44:36 AM
 #9

Testing it on https://btcforeveryone.xyz Smiley

Thanks!

alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 23, 2017, 10:55:28 AM
 #10

I'll ask the developer, but since were both still in school.
We both dont have alot of time, but ill ask if he can do it!

Thanks for making it again Cheesy
hehehe... Wink

thanks was really easy to implement this in my script (not faucetbox)


now i have a mind. and max. reward depending on the Bitcoin Kurse and payout is a random number , thanks !!

Code:
$get_rate 		= file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1") * 100000000;
$payOut  = rand(intval($get_rate * 0.004), intval($get_rate * 0.002));
$payOutBTC  = $payOut / 100000000;


kind regards
well done... but what's your script? Smiley

youre script orginal faucetbox
because faucetbox.com is closed service
LTU_btc has already said but I am saying once again, faucetbox has been closed but their admin has said that they will develop continuously the script.

Wow, I think many faucet owners wanted for such add-on to set rewards based on USD value. As I understand, this addon in general works in same way like freebitco.in where rewards are alway s same value in USD.
youre script orginal faucetbox
because faucetbox.com is closed service
Yeah, Faucetbox is closed service but their faucet script is still very popular and used on many Faucethub, ePay and some Faucetsystem faucets
Thank you. I will be very happy if this helps faucet owners. Smiley

Testing it on https://btcforeveryone.xyz Smiley

Thanks!
have you done your testing?
Gregc1131
Full Member
***
Offline Offline

Activity: 223
Merit: 103



View Profile WWW
March 23, 2017, 11:23:06 AM
 #11

Testing it on https://btcforeveryone.xyz Smiley

Thanks!
Quote
have you done your testing?

Hello , will leave it for the rest of day if any errors show up Smiley
Btw is it possible to use with random rewards, ie 0.01-0.05?

tungaqhd
Hero Member
*****
Offline Offline

Activity: 1540
Merit: 508


View Profile
March 23, 2017, 11:36:51 AM
 #12

Testing it on https://btcforeveryone.xyz Smiley

Thanks!
Quote
have you done your testing?

Hello , will leave it for the rest of day if any errors show up Smiley
Btw is it possible to use with random rewards, ie 0.01-0.05?
$reward =rand(0.01,0.05);
or follow felicita's code
Gregc1131
Full Member
***
Offline Offline

Activity: 223
Merit: 103



View Profile WWW
March 23, 2017, 12:08:43 PM
 #13

Testing it on https://btcforeveryone.xyz Smiley

Thanks!
Quote
have you done your testing?

Hello , will leave it for the rest of day if any errors show up Smiley
Btw is it possible to use with random rewards, ie 0.01-0.05?
$reward =rand(0.01,0.05);
or follow felicita's code

Thanks, it slipped past me Smiley

alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 23, 2017, 01:20:26 PM
 #14

Testing it on https://btcforeveryone.xyz Smiley

Thanks!
Quote
have you done your testing?

Hello , will leave it for the rest of day if any errors show up Smiley
Btw is it possible to use with random rewards, ie 0.01-0.05?
$reward =rand(0.01,0.05);
or follow felicita's code

Thanks, it slipped past me Smiley
Just use random function. tungaqhd and felicita has already given example. Let me know if you need any help.
Gregc1131
Full Member
***
Offline Offline

Activity: 223
Merit: 103



View Profile WWW
March 23, 2017, 06:22:21 PM
 #15

I have been playing around for option for alt coins, so far i know cryptonator is the only free option that supports all coins from FB script.

Same instructions as in OP

Code:
   if ($this->currency === "LTC") {
            $api = "https://api.cryptonator.com/api/full/ltc-usd";
            $json = file_get_contents($api);
            $data = json_decode($json, true);
            $get_rate = $data["ticker"]["price"];
            $amount1 = number_format($get_rate, 8);
            $amount2 = number_format(1 / $amount1, 8);
            $rate = $amount2 * 100000000;
            $amount = intval($amount * $rate);
        }

Above is Litecoin example, replace "LTC" and "ltc-usd" in second line with the coin/currency you need.

So far no issues, amount1 and 2 could probably get improved with one line tho.

Thanks to OP for most of the work and idea in the first place Smiley

alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 24, 2017, 06:28:52 AM
 #16

I have been playing around for option for alt coins, so far i know cryptonator is the only free option that supports all coins from FB script.

Same instructions as in OP

Code:
   if ($this->currency === "LTC") {
            $api = "https://api.cryptonator.com/api/full/ltc-usd";
            $json = file_get_contents($api);
            $data = json_decode($json, true);
            $get_rate = $data["ticker"]["price"];
            $amount1 = number_format($get_rate, 8);
            $amount2 = number_format(1 / $amount1, 8);
            $rate = $amount2 * 100000000;
            $amount = intval($amount * $rate);
        }

Above is Litecoin example, replace "LTC" and "ltc-usd" in second line with the coin/currency you need.

So far no issues, amount1 and 2 could probably get improved with one line tho.

Thanks to OP for most of the work and idea in the first place Smiley
bah, thank you for providing codes for alt coin. this will help faucet owners who have alt coin faucet. Smiley
I am also using cryptonator in my exchanger: http://micro-exchanger.info . I think it's the best option.
hoop
Legendary
*
Offline Offline

Activity: 1523
Merit: 1001


NOBT - WNOBT your saving bank◕◡◕


View Profile WWW
March 24, 2017, 09:37:34 PM
 #17

 Good add-on for faucetinbox script and of course for faucet owner as well.

            ██████████  ██████████▄▄
         █████████████  ██████████████▄▄
   ▄███  █████▄                  ▀▀███████▄
  ██████   ▀█████▄          ████     ▀▀█████
 █████        ▀█████▄       ████        █████
 ████            ▀████      ████         ████
 ████         ██▄   ▀█  ██▄ ████         ████
 ████▌        █████▄    ████████        ▐████
 ▐████        ████████    ▀█████        ████▌
  █████       ████ ▀██  █▄   ▀██       █████
   █████      ████      ████▄         █████
    █████▄    ████       ▀█████▄    ▄█████
     ▀█████▄  ████          ▀█████▄   ██▀
       ▀█████▄                 ▀█████
         ▀██████▄▄          ▄▄██████▀
            ▀▀████████  ████████▀▀
                ▀▀████  ████▀▀
Take care of your financial privacy
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
A blockchain loyalty scheme and more
██
██
██
██
██
██
██
██
██
██
██
██


███████████████
███          ██████████████████
████████████████████████████████
███                          ███
███                          ███
███             ██           ███
███       ██   ██   ██       ███
███      ██    ██    ██      ███
███       ██  ██    ██       ███
███                          ███
███                          ███
████████████████████████████████


           ████    ████
       █████████ ████████
                           
████████████████████████████
█████████████████████████████
██████████████████
██████████████████ ███████████
██████████████████ ██    █████
██████████████████ ███████████
██████████████████
█████████████████████████████
████████████████████████████


        ▄█████▄
      ▄█████████
     ████    ███▌
    ███       ██▌
   ▐██ ███  ████
   ▄███████████
  ███████████▀
 ████  ███ ██▌
▐██       ███
▐███    ████
 █████████▀
  ▀█████▀
██
██
██
██
██
██
██
██
██
██
██
██
ANN         Discord
Twitter    Telegram
Nobt-plataform
alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 25, 2017, 03:52:47 AM
 #18

Good add-on for faucetinbox script and of course for faucet owner as well.
thank you... Smiley Smiley Smiley
jooj
Sr. Member
****
Offline Offline

Activity: 650
Merit: 350


NOBT - WNOBT your saving bank◕◡◕


View Profile WWW
March 25, 2017, 07:54:31 AM
 #19

Great work mate Smiley but how we can shown rewards as BTC like Rewards on Freebitco.in faucet and Rewards will be changed automatically according to bitcoin price?

            ██████████  ██████████▄▄
         █████████████  ██████████████▄▄
   ▄███  █████▄                  ▀▀███████▄
  ██████   ▀█████▄          ████     ▀▀█████
 █████        ▀█████▄       ████        █████
 ████            ▀████      ████         ████
 ████         ██▄   ▀█  ██▄ ████         ████
 ████▌        █████▄    ████████        ▐████
 ▐████        ████████    ▀█████        ████▌
  █████       ████ ▀██  █▄   ▀██       █████
   █████      ████      ████▄         █████
    █████▄    ████       ▀█████▄    ▄█████
     ▀█████▄  ████          ▀█████▄   ██▀
       ▀█████▄                 ▀█████
         ▀██████▄▄          ▄▄██████▀
            ▀▀████████  ████████▀▀
                ▀▀████  ████▀▀
Take care of your financial privacy
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
A blockchain loyalty scheme and more
██
██
██
██
██
██
██
██
██
██
██
██


███████████████
███          ██████████████████
████████████████████████████████
███                          ███
███                          ███
███             ██           ███
███       ██   ██   ██       ███
███      ██    ██    ██      ███
███       ██  ██    ██       ███
███                          ███
███                          ███
████████████████████████████████


           ████    ████
       █████████ ████████
                           
████████████████████████████
█████████████████████████████
██████████████████
██████████████████ ███████████
██████████████████ ██    █████
██████████████████ ███████████
██████████████████
█████████████████████████████
████████████████████████████


        ▄█████▄
      ▄█████████
     ████    ███▌
    ███       ██▌
   ▐██ ███  ████
   ▄███████████
  ███████████▀
 ████  ███ ██▌
▐██       ███
▐███    ████
 █████████▀
  ▀█████▀
██
██
██
██
██
██
██
██
██
██
██
██
ANN         Discord
Twitter    Telegram
Nobt-plataform
alamin99 (OP)
Hero Member
*****
Offline Offline

Activity: 1078
Merit: 500


View Profile
March 26, 2017, 02:02:26 PM
 #20

Great work mate Smiley but how we can shown rewards as BTC like Rewards on Freebitco.in faucet and Rewards will be changed automatically according to bitcoin price?
thank you. just follow the guides above for it.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!