Skip to content

Commit

Permalink
CSS Changes and CNY Price feed adaption
Browse files Browse the repository at this point in the history
	new file:   .gitignore
	modified:   charts/css/style.css
	modified:   charts/index.php
	modified:   index.php
	modified:   volume/css/style.css
	modified:   volume/exchanges.php
	modified:   volume/functions.php
	modified:   volume/gui_index.php
	modified:   walls/css/style.css
	modified:   walls/exchanges.php
	modified:   walls/functions.php
	modified:   walls/gather_exchanges.php
	modified:   walls/index.php
  • Loading branch information
willyfromtheblock committed Mar 29, 2016
1 parent d88ba60 commit 2f87ced
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
panel/
7 changes: 3 additions & 4 deletions charts/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ a:active { color: #000000; text-decoration: none}

#banner { text-align: center; margin:0 0 5px 0; }
#chart { margin:5px 0 5px 0; padding: 50px; }
#footer {
position: fixed;
bottom: 0;
width: 100%;
p.footer_link {
display: inline;
color: white;
}
12 changes: 7 additions & 5 deletions charts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@
<br>
<div id="chart" align="center"></div>​
<?php echo "<script>setSelect(\"$selected_chart\");</script>";?>
<div id="footer" align="center">
<a href="https://alix.coinerella.com/walls"><p class="white_link">ALix Walls -</p></a>
<a href="https://alix.coinerella.com/volume"><p class="white_link"> ALix Volume -</p></a>
<a href="https://alix.coinerella.com/charts"><p class="white_link"> ALix Charts -</p></a>
<a href="https://www.coinerella.com/index.php/ALix" target="_blank"><p class="white_link"> About ALix</p></a>
</div>
<footer align="center">
<a href="https://alix.coinerella.com/walls"><p class="footer_link">ALix Walls -</p></a>
<a href="https://alix.coinerella.com/volume"><p class="footer_link"> ALix Volume -</p></a>
<a href="https://alix.coinerella.com/charts"><p class="footer_link"> ALix Charts -</p></a>
<a href="https://alix.coinerella.com/panel"><p class="footer_link"> ALix Panel -</p></a>
<a href="https://www.coinerella.com/index.php/ALix" target="_blank"><p class="footer_link"> About ALix</p></a>
</footer>
</body>
</html>
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<h2><a href='volume'>Volume</a><br>
<a href='walls'>Walls</a><br>
<a href='charts'>Charts</a><br>
<a href='panel'>Panel</a><br>
<a href='https://www.coinerella.com/index.php/ALix' target="_blank">About</a>
</h2>
</p>
Expand Down
7 changes: 3 additions & 4 deletions volume/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ p.white_link {
display: inline;
}
p:hover { color: #ffb800; text-decoration: none}
#footer {
position: fixed;
bottom: 0;
width: 100%;
p.footer_link {
display: inline;
color: white;
}
4 changes: 2 additions & 2 deletions volume/exchanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function get_bittrex_btc_nbt () {

//southx BTC-NBT
function get_southx_btc_nbt ($btc_usd) {
$url = 'https://www.southxchange.com/api/price/btc/nbt';
$url = 'https://www.southxchange.com/api/price/btc/us-nbt';
$content = file_get_contents($url);
$json = json_decode($content, true);

Expand All @@ -112,7 +112,7 @@ function get_southx_btc_nbt ($btc_usd) {

//southx NBT-USD
function get_southx_nbt_usd() {
$url = 'https://www.southxchange.com/api/price/nbt/usd';
$url = 'https://www.southxchange.com/api/price/us-nbt/usd';
$content = file_get_contents($url);
$json = json_decode($content, true);

Expand Down
12 changes: 6 additions & 6 deletions volume/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ function pair2link($pairname)
$answer = "<a href='https://www.bittrex.com/Market/Index?MarketName=BTC-NBT' target='_blank'>Bittrex BTC/NBT</a>";
break;
case "southx_btc_nbt":
$answer = "<a href='https://www.southxchange.com/Market/Book/BTC/NBT' target='_blank'>southXchange BTC/NBT</a>";
$answer = "<a href='https://www.southxchange.com/Market/Book/BTC/US-NBT' target='_blank'>southXchange BTC/NBT</a>";
break;
case "southx_nbt_usd":
$answer = "<a href='https://www.southxchange.com/Market/Book/NBT/USD' target='_blank'>southXchange NBT/USD</a>";
$answer = "<a href='https://www.southxchange.com/Market/Book/US-NBT/USD' target='_blank'>southXchange NBT/USD</a>";
break;
case "cryptsy_nbt_btc":
$answer = "<a href='https://www.cryptsy.com/markets/view/NBT_BTC' target='_blank'>Cryptsy NBT/BTC</a>";
Expand All @@ -84,16 +84,16 @@ function pair2link($pairname)
$answer = "<a href='https://hitbtc.com/exchange/NBTBTC' target='_blank'>HitBTC NBT/BTC</a>";
break;
case "ccedk_nbt_usd":
$answer = "<a href='https://www.ccedk.com/nbt-usd' target='_blank'>CCEDK NBT/USD</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-usd' target='_blank'>CCEDK NBT/USD</a>";
break;
case "ccedk_nbt_eur":
$answer = "<a href='https://www.ccedk.com/nbt-eur' target='_blank'>CCEDK NBT/EUR</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-eur' target='_blank'>CCEDK NBT/EUR</a>";
break;
case "ccedk_nbt_btc":
$answer = "<a href='https://www.ccedk.com/nbt-btc' target='_blank'>CCEDK NBT/BTC</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-btc' target='_blank'>CCEDK NBT/BTC</a>";
break;
case "ccedk_nbt_ppc":
$answer = "<a href='https://www.ccedk.com/nbt-ppc' target='_blank'>CCEDK NBT/PPC</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-ppc' target='_blank'>CCEDK NBT/PPC</a>";
break;
case "nulagoon_btc_nbt":
$answer = "<a href='https://nulagoon.com/' target='_blank'>NuLagoon Tube BTC/NBT</a>";
Expand Down
16 changes: 9 additions & 7 deletions volume/gui_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@
}
echo "</tr></tfoot>";
?>
</table><br>
<div id="footer" align="center">
<a href="https://alix.coinerella.com/walls"><p class="white_link">ALix Walls -</p></a>
<a href="https://alix.coinerella.com/volume"><p class="white_link"> ALix Volume -</p></a>
<a href="https://alix.coinerella.com/charts"><p class="white_link"> ALix Charts -</p></a>
<a href="https://www.coinerella.com/index.php/ALix" target="_blank"><p class="white_link"> About ALix</p></a>
</div>
</table>
</div><br>
<footer align="center">
<a href="https://alix.coinerella.com/walls"><p class="footer_link">ALix Walls -</p></a>
<a href="https://alix.coinerella.com/volume"><p class="footer_link"> ALix Volume -</p></a>
<a href="https://alix.coinerella.com/charts"><p class="footer_link"> ALix Charts -</p></a>
<a href="https://alix.coinerella.com/panel"><p class="footer_link"> ALix Panel -</p></a>
<a href="https://www.coinerella.com/index.php/ALix" target="_blank"><p class="footer_link"> About ALix</p></a>
</footer>
</body>
7 changes: 3 additions & 4 deletions walls/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ p.white_menu {
}
p:hover { color: #ffb800; text-decoration: none}

#footer {
position: fixed;
bottom: 0;
width: 100%;
p.footer_link {
display: inline;
color: white;
}
16 changes: 12 additions & 4 deletions walls/exchanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ function check_value($value)
//get btc-usd price
function get_btc_usd()
{
$btc_usd=false;

$url = 'https://api.bitfinex.com/v1/pubticker/btcusd/';
$content = file_get_contents($url);
$json = json_decode($content, true);
Expand Down Expand Up @@ -41,13 +43,17 @@ function get_btc_usd()
//get nbt/cny price
function get_nbt_cny($btc_usd)
{
$nbt_cny = false;

$url = 'https://www.okcoin.cn/api/ticker.do';
$content = file_get_contents($url);
$json = json_decode($content, true);

if(check_value($json['ticker']['last']))
{
$nbt_cny=$json['ticker']['last']/$btc_usd;
$nbt_cny=$json['ticker']['last'];
$nbt_cny/=$btc_usd;
$nbt_cny*=0.985;
}

if(!$nbt_cny){
Expand All @@ -68,6 +74,8 @@ function get_nbt_cny($btc_usd)
//get nbt/eur price
function get_nbt_eur()
{
$nbt_eur = false;

$url = 'http://finance.yahoo.com/webservice/v1/symbols/allcurrencies/quote?format=json';
$content = file_get_contents($url);
$json = json_decode($content, true);
Expand Down Expand Up @@ -187,7 +195,7 @@ function get_bittrex_btc_nbt($search_tolerance,$btc_usd) {

//southx BTC-NBT
function get_southx_btc_nbt($search_tolerance,$btc_usd) {
$url = 'https://www.southxchange.com/api/book/btc/nbt';
$url = 'https://www.southxchange.com/api/book/btc/us-nbt';
$content = file_get_contents($url);
$json = json_decode($content, true);
$ask_total=0;
Expand Down Expand Up @@ -232,7 +240,7 @@ function get_southx_btc_nbt($search_tolerance,$btc_usd) {

//southx NBT-USD
function get_southx_nbt_usd($search_tolerance) {
$url = 'https://www.southxchange.com/api/book/nbt/usd';
$url = 'https://www.southxchange.com/api/book/us-nbt/usd';
$content = file_get_contents($url);
$json = json_decode($content, true);
$ask_total=0;
Expand Down Expand Up @@ -373,7 +381,7 @@ function get_bter_nbt_cny($search_tolerance,$nbt_cny) {
else {
$tolerance=($nbt_cny*$search_tolerance)/100;
$ask_price=$nbt_cny+$tolerance;
$bid_price=$nbt_cny-$tolerance;
$bid_price=$nbt_cny-$tolerance;

foreach ($json["asks"] as $item)
{
Expand Down
10 changes: 5 additions & 5 deletions walls/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ function pair2link($pairname)
$answer = "<a href='https://www.bittrex.com/Market/Index?MarketName=BTC-NBT' target='_blank'>Bittrex BTC/NBT</a>";
break;
case "southx_btc_nbt":
$answer = "<a href='https://www.southxchange.com/Market/Book/BTC/NBT' target='_blank'>southXchange BTC/NBT</a>";
$answer = "<a href='https://www.southxchange.com/Market/Book/BTC/US-NBT' target='_blank'>southXchange BTC/NBT</a>";
break;
case "southx_nbt_usd":
$answer = "<a href='https://www.southxchange.com/Market/Book/NBT/USD' target='_blank'>southXchange NBT/USD</a>";
$answer = "<a href='https://www.southxchange.com/Market/Book/US-NBT/USD' target='_blank'>southXchange NBT/USD</a>";
break;
case "cryptsy_nbt_btc":
$answer = "<a href='https://www.cryptsy.com/markets/view/NBT_BTC' target='_blank'>Cryptsy NBT/BTC</a>";
Expand All @@ -37,13 +37,13 @@ function pair2link($pairname)
$answer = "<a href='https://hitbtc.com/exchange/NBTBTC' target='_blank'>HitBTC NBT/BTC</a>";
break;
case "ccedk_nbt_usd":
$answer = "<a href='https://www.ccedk.com/nbt-usd' target='_blank'>CCEDK NBT/USD</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-usd' target='_blank'>CCEDK NBT/USD</a>";
break;
case "ccedk_nbt_eur":
$answer = "<a href='https://www.ccedk.com/nbt-eur' target='_blank'>CCEDK NBT/EUR</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-eur' target='_blank'>CCEDK NBT/EUR</a>";
break;
case "ccedk_nbt_btc":
$answer = "<a href='https://www.ccedk.com/nbt-btc' target='_blank'>CCEDK NBT/BTC</a>";
$answer = "<a href='https://www.ccedk.com/us-nbt-btc' target='_blank'>CCEDK NBT/BTC</a>";
break;
case "nulagoon_btc_nbt":
$answer = "<a href='https://nulagoon.com/' target='_blank'>NuLagoon Tube BTC/NBT</a>";
Expand Down
28 changes: 19 additions & 9 deletions walls/gather_exchanges.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
include('config.php');
include('logger.php');
include('exchanges.php');
include("functions.php");
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
include('functions.php');
#error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);

#try to open lock file
$fp = fopen(".lock_walls", "r+");
#$fp = fopen(".lock_walls", "r+");

if (flock($fp, LOCK_EX)) {
#if (flock($fp, LOCK_EX)) {
#we have a lock - let's go.

#get fiat prices
Expand All @@ -21,6 +21,16 @@
writelog("all", "no_bitcoin_price", "unresolved");
exit; #no bitcoin price available, sorry. will not gather data (offline?)
}
if (!$nbt_cny)
{
writelog("all", "no_cny_price", "unresolved");
exit; #no cny price available, sorry. will not gather data (offline?)
}
if (!$nbt_eur)
{
writelog("all", "no_eur_price", "unresolved");
exit; #no eur price available, sorry. will not gather data (offline?)
}

#do the query
$timestamp=time();
Expand All @@ -32,9 +42,9 @@
#create chart points
include("../charts/createcsv_walls.php");
#unlock if we locked
flock($fp, LOCK_UN);
}
else {
writelog("all", "file_locked", "unresolved");
}
# flock($fp, LOCK_UN);
#}
#else {
# writelog("all", "file_locked", "unresolved");
#}
?>
13 changes: 7 additions & 6 deletions walls/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@

}
?>
<div id="footer" align="center">
<a href="https://alix.coinerella.com/walls"><p class="white_link">ALix Walls -</p></a>
<a href="https://alix.coinerella.com/volume"><p class="white_link"> ALix Volume -</p></a>
<a href="https://alix.coinerella.com/charts"><p class="white_link"> ALix Charts -</p></a>
<a href="https://www.coinerella.com/index.php/ALix" target="_blank"><p class="white_link"> About ALix</p></a>
</div>
<footer align="center">
<a href="https://alix.coinerella.com/walls"><p class="footer_link">ALix Walls -</p></a>
<a href="https://alix.coinerella.com/volume"><p class="footer_link"> ALix Volume -</p></a>
<a href="https://alix.coinerella.com/charts"><p class="footer_link"> ALix Charts -</p></a>
<a href="https://alix.coinerella.com/panel"><p class="footer_link"> ALix Panel -</p></a>
<a href="https://www.coinerella.com/index.php/ALix" target="_blank"><p class="footer_link"> About ALix</p></a>
</footer>
</body>
</html>

0 comments on commit 2f87ced

Please sign in to comment.