Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This request will add franko support #7

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
coinwidget.com
==============

*The Bitcoin and Litecoin Donation Button*
*The Bitcoin, Litecoin, Franko Donation Button*

Visit http://coinwidget.com/ for full documentation, demo, and a link code wizard.

Expand All @@ -15,17 +15,18 @@ Donations are welcome and will go towards further development of this project as

BTC: 122MeuyZpYz4GSHNrF98e6dnQCXZfHJeGS
LTC: LY1L6M6yG26b4sRkLv4BbkmHhPn8GR5fFm
FRK: FNHGjAavM3RPqFZ4h3YEqT4uoNxENoY7MX

*Thank you for your support and generosity!*


Installation
==============
A. Grab the latest version from GitHub: https://github.com/scottycc/coinwidget.com
A. Grab the latest version from GitHub: https://github.com/franko-org/coinwidget.com-with-franko-support

B. Open **widget/coin.js** and find:

source: 'http://coinwidget.com/widget/'
source: 'http://frankos.org/widget/'

C. Change the URL portion of this line to your own server/path.

Expand Down
5 changes: 3 additions & 2 deletions coin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Donations welcome:
BTC: 122MeuyZpYz4GSHNrF98e6dnQCXZfHJeGS
LTC: LY1L6M6yG26b4sRkLv4BbkmHhPn8GR5fFm
FRK: FE35Ez4oq8jVfEaKJAHTugkkwzVVhuLxVZ
~ Thank you!

------------
Expand Down Expand Up @@ -48,7 +49,7 @@ var CoinWidgetCom = {
}
, validate: function(config) {
var $accepted = [];
$accepted['currencies'] = ['bitcoin','litecoin'];
$accepted['currencies'] = ['bitcoin','litecoin','franko'];
$accepted['counters'] = ['count','amount','hide'];
$accepted['alignment'] = ['al','ac','ar','bl','bc','br'];
if (!config.currency || !CoinWidgetCom.in_array(config.currency,$accepted['currencies']))
Expand Down Expand Up @@ -329,4 +330,4 @@ var CoinWidgetCom = {
CoinWidgetCom.init();
}
}
};
};
Binary file added icon_franko.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Donations welcome:
BTC: 122MeuyZpYz4GSHNrF98e6dnQCXZfHJeGS
LTC: LY1L6M6yG26b4sRkLv4BbkmHhPn8GR5fFm
FRK: FE35Ez4oq8jVfEaKJAHTugkkwzVVhuLxVZ
~ Thank you!

MIT License (MIT)
Expand Down Expand Up @@ -50,6 +51,9 @@
case 'litecoin':
$response = get_litecoin($address);
break;
case 'franko':
$response = get_franko($address);
break;
}
$responses[$instance] = $response;
}
Expand Down Expand Up @@ -83,6 +87,20 @@ function get_litecoin($address) {
return $return;
}
}

function get_franko($address) {
$return = array();
$data = get_request('http://frk.cryptocoinexplorer.com/address/'.$address);
if (!empty($data)
&& strstr($data, 'Transactions in: ')
&& strstr($data, 'Received: ')) {
$return += array(
'count' => (int) parse($data,'Transactions in: ','<br />'),
'amount' => (float) parse($data,'Received: ','<br />')
);
return $return;
}
}

function get_request($url,$timeout=4) {
if (function_exists('curl_version')) {
Expand Down