diff --git a/coingecko-original.json b/coingecko-original.json new file mode 100644 index 0000000..41f340f --- /dev/null +++ b/coingecko-original.json @@ -0,0 +1 @@ +{"btc":0.00210958,"btc_market_cap":38350.836660765344,"btc_24h_vol":1072.3066955927313,"btc_24h_change":5.255455513612239,"eth":0.0384915,"eth_market_cap":699991.3188912185,"eth_24h_vol":19565.33959790349,"eth_24h_change":5.353924144696235,"ltc":1.659812,"ltc_market_cap":30175347.858143877,"ltc_24h_vol":843686.9562608091,"ltc_24h_change":1.6080866915236671,"bch":0.28913088,"bch_market_cap":5248274.849952233,"bch_24h_vol":146966.05524084004,"bch_24h_change":4.322945809692873,"bnb":0.23850071,"bnb_market_cap":4336695.187221306,"bnb_24h_vol":121230.59447380874,"bnb_24h_change":4.3825856285337546,"eos":172.292,"eos_market_cap":3133440296.2667646,"eos_24h_vol":87576440.19315542,"eos_24h_change":3.8392514017844506,"xrp":272.085,"xrp_market_cap":4943278575.459774,"xrp_24h_vol":138301772.78823096,"xrp_24h_change":2.04791983559113,"xlm":1306,"xlm_market_cap":23744909982.490067,"xlm_24h_vol":663771601.4290903,"xlm_24h_change":2.7363910959260007,"link":8.087602,"link_market_cap":147246147.73942026,"link_24h_vol":4110951.083711284,"link_24h_change":-4.127507037761055,"dot":19.807366,"dot_market_cap":360615128.49905366,"dot_24h_vol":10068140.764441755,"dot_24h_change":5.549917410141326,"yfi":0.02040779,"yfi_market_cap":371139.42097088625,"yfi_24h_vol":10373.339350942399,"yfi_24h_change":4.005902848652121,"usd":142.12,"usd_market_cap":2581922105.09601,"usd_24h_vol":72239608.29222855,"usd_24h_change":1.6833616102628728,"aed":522,"aed_market_cap":9483296615.133425,"aed_24h_vol":265333191.67302343,"aed_24h_change":1.6817005788236015,"ars":126525,"ars_market_cap":2298524654612.042,"ars_24h_vol":64313202948.53927,"ars_24h_change":1.71503041468998,"aud":214.77,"aud_market_cap":3901568312.231652,"aud_24h_vol":109169868.60377376,"aud_24h_change":2.0402820373148916,"bdt":16725.09,"bdt_market_cap":303849648128.521,"bdt_24h_vol":8501410448.135741,"bdt_24h_change":2.0325108271122776,"bhd":53.57,"bhd_market_cap":973149678.7096316,"bhd_24h_vol":27227758.521815628,"bhd_24h_change":1.6714925764288402,"bmd":142.12,"bmd_market_cap":2581922105.09601,"bmd_24h_vol":72239608.29222855,"bmd_24h_change":1.6833616102628728,"brl":731.16,"brl_market_cap":13283214654.087439,"brl_24h_vol":371651112.7810289,"brl_24h_change":1.4703502039221115,"cad":194.9,"cad_market_cap":3541235263.244433,"cad_24h_vol":99069398.81196225,"cad_24h_change":2.0173691847411477,"chf":130.02,"chf_market_cap":2362257336.2386537,"chf_24h_vol":66088839.08379504,"chf_24h_change":1.830621848711115,"clp":129290,"clp_market_cap":2348851996668.993,"clp_24h_vol":65718538851.689125,"clp_24h_change":2.932495696741406,"cny":1010.5,"cny_market_cap":18357982551.65366,"cny_24h_vol":513638062.8794039,"cny_24h_change":1.6776415100402144,"czk":3241.92,"czk_market_cap":58898548869.23949,"czk_24h_vol":1647876992.7294424,"czk_24h_change":1.7880712206175122,"dkk":978.25,"dkk_market_cap":17772712448.8705,"dkk_24h_vol":497246534.5598557,"dkk_24h_change":1.7510202562620967,"eur":131.11,"eur_market_cap":2382104571.460527,"eur_24h_vol":66645373.02607839,"eur_24h_change":1.7639953691673225,"gbp":111.73,"gbp_market_cap":2029798718.298071,"gbp_24h_vol":56793479.72640087,"gbp_24h_change":1.7497554281506258,"hkd":1110.36,"hkd_market_cap":20172221757.24148,"hkd_24h_vol":564401630.2620435,"hkd_24h_change":1.7451282351763902,"huf":50508,"huf_market_cap":917635107973.9802,"huf_24h_vol":25673234390.975166,"huf_24h_change":1.2592758871994356,"idr":2281231,"idr_market_cap":41443291514776.45,"idr_24h_vol":1159556457132.1758,"idr_24h_change":1.6211998257331415,"ils":521.33,"ils_market_cap":9469473004.182758,"ils_24h_vol":264992943.1179674,"ils_24h_change":1.6203933953952274,"inr":11812.48,"inr_market_cap":214592580299.97504,"inr_24h_vol":6004318211.740721,"inr_24h_change":1.5406846956173381,"jpy":22304,"jpy_market_cap":405289476681.13074,"jpy_24h_vol":11337428604.59899,"jpy_24h_change":1.8429962337133752,"krw":194097,"krw_market_cap":3526319204904.1753,"krw_24h_vol":98659845599.41933,"krw_24h_change":1.8989058291732408,"kwd":43.63,"kwd_market_cap":792709470.4728911,"kwd_24h_vol":22179221.256704886,"kwd_24h_change":1.7082070307276431,"lkr":42789,"lkr_market_cap":777360441869.0621,"lkr_24h_vol":21749770727.651997,"lkr_24h_change":1.9548123398911443,"mmk":299419,"mmk_market_cap":5439630448649.272,"mmk_24h_vol":152195440787.81995,"mmk_24h_change":1.8985053871045827,"mxn":2375.11,"mxn_market_cap":43137138248.70617,"mxn_24h_vol":1207275052.0633,"mxn_24h_change":2.0539892011089957,"myr":669.59,"myr_market_cap":12164725998.15984,"myr_24h_vol":340356914.4688355,"myr_24h_change":1.8346600545763585,"ngn":210336,"ngn_market_cap":3821244715542.0967,"ngn_24h_vol":106914620272.49826,"ngn_24h_change":3.966407725864244,"nok":1508.67,"nok_market_cap":27397573271.104263,"nok_24h_vol":766863173.8065671,"nok_24h_change":1.4682772129546449,"nzd":232.54,"nzd_market_cap":4224262100.7707405,"nzd_24h_vol":118199964.11951818,"nzd_24h_change":1.972910603132652,"php":8269.56,"php_market_cap":150256247867.115,"php_24h_vol":4203442279.7436585,"php_24h_change":1.6803053034801858,"pkr":39680,"pkr_market_cap":720882106741.5562,"pkr_24h_vol":20169563176.63578,"pkr_24h_change":1.8801190233490541,"pln":558.14,"pln_market_cap":10138407710.859442,"pln_24h_vol":283702495.9883962,"pln_24h_change":1.580519960951813,"rub":12792.01,"rub_market_cap":232396229339.5091,"rub_24h_vol":6502214975.014808,"rub_24h_change":1.2257410580094512,"sar":533.03,"sar_market_cap":9683862906.179407,"sar_24h_vol":270939418.7141503,"sar_24h_change":1.6843376325898571,"sek":1520.94,"sek_market_cap":27619634063.675125,"sek_24h_vol":773096729.6061041,"sek_24h_change":1.8531320581160846,"sgd":191.86,"sgd_market_cap":3485463163.8522544,"sgd_24h_vol":97522243.12116764,"sgd_24h_change":1.7386780028798337,"thb":5207.83,"thb_market_cap":94623572268.61096,"thb_24h_vol":2647153913.1894813,"thb_24h_change":1.9929972535126714,"try":4583.32,"try_market_cap":83276799193.34557,"try_24h_vol":2329713280.7007546,"try_24h_change":1.789693818940375,"twd":4576.12,"twd_market_cap":83139182745.14397,"twd_24h_vol":2326056367.249782,"twd_24h_change":1.6852911534098216,"uah":5695.64,"uah_market_cap":103474403826.8023,"uah_24h_vol":2895110733.9631066,"uah_24h_change":2.307599673063141,"vef":14.23,"vef_market_cap":258527860.38326353,"vef_24h_vol":7233351.978300847,"vef_24h_change":1.683361610262816,"vnd":3619950,"vnd_market_cap":65764703836841.74,"vnd_24h_vol":1840030896071.9756,"vnd_24h_change":1.6833682091854942,"zar":2613.25,"zar_market_cap":47500911928.50394,"zar_24h_vol":1328320895.5514839,"zar_24h_change":1.7739068403403242,"xdr":107.37,"xdr_market_cap":1950564692.736883,"xdr_24h_vol":54574856.87652996,"xdr_24h_change":1.5748584125993856,"xag":4.65,"xag_market_cap":84482427.7203202,"xag_24h_vol":2361847.98685543,"xag_24h_change":1.4685977540292445,"xau":0.060675,"xau_market_cap":1102713.1118654548,"xau_24h_vol":30841.25596820115,"xau_24h_change":2.652347061408199,"bits":2109.58,"bits_market_cap":38350836660.76534,"bits_24h_vol":1072306695.5927315,"bits_24h_change":5.255455513612264,"sats":210958,"sats_market_cap":3835083666076.5347,"sats_24h_vol":107230669559.27315,"sats_24h_change":5.255455513612257,"last_updated_at":1716546848,"time":1716546880} \ No newline at end of file diff --git a/coingecko.json b/coingecko.json index d5a8123..e59525d 100644 --- a/coingecko.json +++ b/coingecko.json @@ -1 +1 @@ -{"btc":0.00212124,"btc_market_cap":38640.57417958834,"btc_24h_vol":1061.8342517832964,"btc_24h_change":6.047719285138861,"eth":0.03871713,"eth_market_cap":707816.8156162383,"eth_24h_vol":19380.73975884224,"eth_24h_change":5.6069802470912204,"ltc":1.668126,"ltc_market_cap":30479905.850164514,"ltc_24h_vol":835018.2832124284,"ltc_24h_change":3.3899385528478154,"bch":0.29140466,"bch_market_cap":5323089.303758959,"bch_24h_vol":145869.2431964401,"bch_24h_change":6.091121043103146,"bnb":0.23977434,"bnb_market_cap":4377051.206548583,"bnb_24h_vol":120024.51143650037,"bnb_24h_change":5.5541635263390665,"eos":173.843,"eos_market_cap":3180740852.1755323,"eos_24h_vol":87021106.50333622,"eos_24h_change":6.359327526007279,"xrp":271.932,"xrp_market_cap":4965777256.711917,"xrp_24h_vol":136121819.70597062,"xrp_24h_change":3.344981714050716,"xlm":1314,"xlm_market_cap":23972058965.021793,"xlm_24h_vol":657512999.1605921,"xlm_24h_change":4.595217434191829,"link":8.384578,"link_market_cap":153316338.6680131,"link_24h_vol":4197091.793054756,"link_24h_change":0.22596626954145602,"dot":19.967806,"dot_market_cap":365461372.7250883,"dot_24h_vol":9995340.354633838,"dot_24h_change":8.305778874376207,"yfi":0.02065326,"yfi_market_cap":377321.71547722124,"yfi_24h_vol":10338.462374809009,"yfi_24h_change":5.9856300815431,"usd":141.96,"usd_market_cap":2576806638.1516013,"usd_24h_vol":71060324.80082369,"usd_24h_change":1.9778346667217412,"aed":521.41,"aed_market_cap":9464636549.997225,"aed_24h_vol":261005283.5966732,"aed_24h_change":1.9781123085257983,"ars":126380,"ars_market_cap":2293853685552.1074,"ars_24h_vol":63262625228.086,"ars_24h_change":2.0069472141784397,"aud":214.83,"aud_market_cap":3901957796.69409,"aud_24h_vol":107539142.53732602,"aud_24h_change":2.2624545223051107,"bdt":16706.12,"bdt_market_cap":303247642038.56036,"bdt_24h_vol":8362628231.120002,"bdt_24h_change":2.3279950129772984,"bhd":53.51,"bhd_market_cap":971229343.5989974,"bhd_24h_vol":26783489.14132807,"bhd_24h_change":1.9691774372411663,"bmd":141.96,"bmd_market_cap":2576806638.1516013,"bmd_24h_vol":71060324.80082369,"bmd_24h_change":1.9778346667217412,"brl":730.33,"brl_market_cap":13256897111.29855,"brl_24h_vol":365584053.0027978,"brl_24h_change":1.8014476850388057,"cad":194.85,"cad_market_cap":3537414384.7881355,"cad_24h_vol":97534559.40861852,"cad_24h_change":2.336462621206713,"chf":129.93,"chf_market_cap":2358625843.2926683,"chf_24h_vol":65041728.47116825,"chf_24h_change":2.0927206687217916,"clp":129143,"clp_market_cap":2344198302925.6553,"clp_24h_vol":64645709281.053276,"clp_24h_change":3.2305862214519068,"cny":1009.35,"cny_market_cap":18321610558.585526,"cny_24h_vol":505253121.3988167,"cny_24h_change":1.793151864683173,"czk":3240.7,"czk_market_cap":58847306237.45961,"czk_24h_vol":1622207730.748084,"czk_24h_change":2.0603194837701087,"dkk":978.61,"dkk_market_cap":17767597131.382908,"dkk_24h_vol":489863800.0376767,"dkk_24h_change":2.132389614520396,"eur":131.17,"eur_market_cap":2381319779.3548694,"eur_24h_vol":65657679.366541795,"eur_24h_change":2.1503016278486538,"gbp":111.79,"gbp_market_cap":2029279033.257237,"gbp_24h_vol":55957589.729605414,"gbp_24h_change":2.1789574886688783,"hkd":1108.79,"hkd_market_cap":20126277087.615005,"hkd_24h_vol":555029457.715297,"hkd_24h_change":2.0170836612268004,"huf":50535,"huf_market_cap":917511596147.8734,"huf_24h_vol":25296398496.689922,"huf_24h_change":1.6309164651038832,"idr":2278594,"idr_market_cap":41410202239466.586,"idr_24h_vol":1140602351604.438,"idr_24h_change":1.8533095377563962,"ils":521.28,"ils_market_cap":9462807017.284126,"ils_24h_vol":260936355.08161604,"ils_24h_change":1.9374154782224313,"inr":11789.58,"inr_market_cap":214043752415.8349,"inr_24h_vol":5901545336.281497,"inr_24h_change":1.7200737681876144,"jpy":22294,"jpy_market_cap":404760921510.89435,"jpy_24h_vol":11159656864.721056,"jpy_24h_change":2.1751868432398247,"krw":194216,"krw_market_cap":3527044232617.424,"krw_24h_vol":97219079493.21045,"krw_24h_change":2.2939765884238734,"kwd":43.59,"kwd_market_cap":791164672.5316021,"kwd_24h_vol":21817864.704571284,"kwd_24h_change":2.0080683361273537,"lkr":42740,"lkr_market_cap":775820286325.088,"lkr_24h_vol":21394714185.02504,"lkr_24h_change":2.2500715124337476,"mmk":299079,"mmk_market_cap":5428853109667.999,"mmk_24h_vol":149710909447.8642,"mmk_24h_change":2.1936014957964716,"mxn":2373.21,"mxn_market_cap":43089360603.1711,"mxn_24h_vol":1187965547.2243495,"mxn_24h_change":2.325919089355582,"myr":669.47,"myr_market_cap":12152220105.522947,"myr_24h_vol":335120491.76068455,"myr_24h_change":2.118583350304768,"ngn":208277,"ngn_market_cap":3780622808371.533,"ngn_24h_vol":104257836321.39098,"ngn_24h_change":4.62880574335957,"nok":1510.47,"nok_market_cap":27442895354.468925,"nok_24h_vol":756100900.0478102,"nok_24h_change":1.7179346820408232,"nzd":232.58,"nzd_market_cap":4224030281.5899987,"nzd_24h_vol":116423601.76619855,"nzd_24h_change":2.1699672889551,"php":8268.2,"php_market_cap":150053900286.58295,"php_24h_vol":4138837699.819827,"php_24h_change":2.1435680542627824,"pkr":39635,"pkr_market_cap":719453849637.8356,"pkr_24h_vol":19840302907.299393,"pkr_24h_change":2.1751618854857018,"pln":559.25,"pln_market_cap":10151303982.931837,"pln_24h_vol":279945418.3277854,"pln_24h_change":2.0053844729885277,"rub":12800.54,"rub_market_cap":232354071407.73215,"rub_24h_vol":6407603713.280956,"rub_24h_change":1.9778346667216493,"sar":532.45,"sar_market_cap":9665019341.406425,"sar_24h_vol":266531218.69448462,"sar_24h_change":1.9847681998778965,"sek":1523.39,"sek_market_cap":27671883276.368286,"sek_24h_vol":762565542.03624,"sek_24h_change":2.288257419220508,"sgd":191.79,"sgd_market_cap":3482296490.7980747,"sgd_24h_vol":96002498.80591278,"sgd_24h_change":2.0589681469510235,"thb":5212.7,"thb_market_cap":94615186139.65045,"thb_24h_vol":2609335126.6862483,"thb_24h_change":2.5124516189284356,"try":4580.09,"try_market_cap":83138689769.26982,"try_24h_vol":2292669001.2763357,"try_24h_change":2.1437057594933,"twd":4574.67,"twd_market_cap":83075395667.8169,"twd_24h_vol":2289954425.8086224,"twd_24h_change":1.9737146443612752,"uah":5689.18,"uah_market_cap":103269393810.68945,"uah_24h_vol":2847849177.9405327,"uah_24h_change":2.6038805109270573,"vef":14.21,"vef_market_cap":258015648.6781199,"vef_24h_vol":7115270.322306478,"vef_24h_change":1.9778346667217581,"vnd":3616765,"vnd_market_cap":65651124537942.266,"vnd_24h_vol":1810454135026.5854,"vnd_24h_change":2.0038162799624217,"zar":2611.93,"zar_market_cap":47466414546.9676,"zar_24h_vol":1307460660.4697392,"zar_24h_change":2.0770028867944066,"xdr":107.25,"xdr_market_cap":1946700110.9243898,"xdr_24h_vol":53683943.577278286,"xdr_24h_change":1.8690172458877947,"xag":4.67,"xag_market_cap":84931005.66408293,"xag_24h_vol":2335475.0303330985,"xag_24h_change":2.1557815564826015,"xau":0.060681,"xau_market_cap":1102589.7923986893,"xau_24h_vol":30375.44643936007,"xau_24h_change":2.928963204261684,"bits":2121.24,"bits_market_cap":38640574179.58834,"bits_24h_vol":1061834251.7832963,"bits_24h_change":6.047719285138846,"sats":212124,"sats_market_cap":3864057417958.834,"sats_24h_vol":106183425178.32964,"sats_24h_change":6.047719285138848,"last_updated_at":1716540142,"time":1716540265} \ No newline at end of file +{"time":1716546880,"eur":{"lastValue":131.11,"lastDate":1716546880},"btc":{"lastValue":0.00210958,"lastDate":1716546880},"usd":{"lastValue":142.12,"lastDate":1716546880},"gbp":{"lastValue":111.73,"lastDate":1716546880},"chf":{"lastValue":130.02,"lastDate":1716546880},"rub":{"lastValue":12792.01,"lastDate":1716546880},"cny":{"lastValue":1010.5,"lastDate":1716546880},"jpy":{"lastValue":22304,"lastDate":1716546880},"idr":{"lastValue":2281231,"lastDate":1716546880},"krw":{"lastValue":194097,"lastDate":1716546880},"try":{"lastValue":4583.32,"lastDate":1716546880},"aud":{"lastValue":214.77,"lastDate":1716546880},"bmd":{"lastValue":142.12,"lastDate":1716546880},"cad":{"lastValue":194.9,"lastDate":1716546880},"hkd":{"lastValue":1110.36,"lastDate":1716546880},"nzd":{"lastValue":232.54,"lastDate":1716546880},"sgd":{"lastValue":191.86,"lastDate":1716546880},"twd":{"lastValue":4576.12,"lastDate":1716546880},"ils":{"lastValue":521.33,"lastDate":1716546880},"pln":{"lastValue":558.14,"lastDate":1716546880},"zar":{"lastValue":2613.25,"lastDate":1716546880},"czk":{"lastValue":3241.92,"lastDate":1716546880},"dkk":{"lastValue":978.25,"lastDate":1716546880},"nok":{"lastValue":1508.67,"lastDate":1716546880},"sek":{"lastValue":1520.94,"lastDate":1716546880},"ars":{"lastValue":126525,"lastDate":1716546880},"clp":{"lastValue":129290,"lastDate":1716546880},"php":{"lastValue":8269.56,"lastDate":1716546880},"mxn":{"lastValue":2375.11,"lastDate":1716546880},"bhd":{"lastValue":53.57,"lastDate":1716546880},"kwd":{"lastValue":43.63,"lastDate":1716546880},"brl":{"lastValue":731.16,"lastDate":1716546880},"myr":{"lastValue":669.59,"lastDate":1716546880},"vef":{"lastValue":14.23,"lastDate":1716546880},"uah":{"lastValue":5695.64,"lastDate":1716546880},"vnd":{"lastValue":3619950,"lastDate":1716546880},"bdt":{"lastValue":16725.09,"lastDate":1716546880},"huf":{"lastValue":50508,"lastDate":1716546880},"mmk":{"lastValue":299419,"lastDate":1716546880},"ngn":{"lastValue":210336,"lastDate":1716546880},"thb":{"lastValue":5207.83,"lastDate":1716546880},"aed":{"lastValue":522,"lastDate":1716546880},"sar":{"lastValue":533.03,"lastDate":1716546880},"pkr":{"lastValue":39680,"lastDate":1716546880},"lkr":{"lastValue":42789,"lastDate":1716546880},"inr":{"lastValue":11812.48,"lastDate":1716546880},"ltc":{"lastValue":1.659812,"lastDate":1716546880},"eth":{"lastValue":0.0384915,"lastDate":1716546880},"xag":{"lastValue":4.65,"lastDate":1716546880},"xau":{"lastValue":0.060675,"lastDate":1716546880}} \ No newline at end of file diff --git a/coingecko.php b/coingecko.php index ad5cd23..0277a2e 100644 --- a/coingecko.php +++ b/coingecko.php @@ -1,4 +1,57 @@ coingecko.com"; // Die Standard-Zeitzone, die verwendet werden soll, setzen. @@ -10,9 +63,9 @@ $xmrdatas = json_decode(file_get_contents("coingecko.json"), true); // Liefert den aktuellen Unix-Zeitstempel $zeit = time(); -// Sind 5 Sekunden vergangen? +// Sind ~30 Minuten vergangen? if(($zeit - $xmrdatas['time']) >= 5){ - //echo "Gespeicherte Zeit: ".$xmrdatas['time']."
Aktuelle Zeit: ".$zeit; + //echo "Gespeicherte Zeit: ".$xmrdatas['time']."
Aktuelle Zeit: ".$zeit; // Initialize CURL $ch = curl_init('https://api.coingecko.com/api/v3/simple/price?ids=monero&vs_currencies=btc%2Ceth%2Cltc%2Cbch%2Cbnb%2Ceos%2Cxrp%2Cxlm%2Clink%2Cdot%2Cyfi%2Cusd%2Caed%2Cars%2Caud%2Cbdt%2Cbhd%2Cbmd%2Cbrl%2Ccad%2Cchf%2Cclp%2Ccny%2Cczk%2Cdkk%2Ceur%2Cgbp%2Chkd%2Chuf%2Cidr%2Cils%2Cinr%2Cjpy%2Ckrw%2Ckwd%2Clkr%2Cmmk%2Cmxn%2Cmyr%2Cngn%2Cnok%2Cnzd%2Cphp%2Cpkr%2Cpln%2Crub%2Csar%2Csek%2Csgd%2Cthb%2Ctry%2Ctwd%2Cuah%2Cvef%2Cvnd%2Czar%2Cxdr%2Cxag%2Cxau%2Cbits%2Csats&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true&include_last_updated_at=true'); @@ -22,19 +75,36 @@ if(($zeit - $xmrdatas['time']) >= 5){ $json = curl_exec($ch); curl_close($ch); - // Sortiert/Formatiert die Ausgabe - $sort_array = json_decode($json, true); + // Sortiert/Formatiert die Ausgabe + $sort_array = json_decode($json, true); $new_sort_array = $sort_array['monero']; + // Zeit wird ergänzt + $new_array['time'] = $zeit; $new_sort_array['time'] = $zeit; + + foreach ($array as $fiatValue) { + $fiatValue = strtolower($fiatValue); + if (array_key_exists($fiatValue, $sort_array['monero'])) { + $new_array[$fiatValue]['lastValue'] = $sort_array['monero'][$fiatValue]; + $new_array[$fiatValue]['lastDate'] = $zeit; + }else{ + $new_array[$fiatValue]['lastValue'] = $xmrdatas[$fiatValue]['lastValue']; + $new_array[$fiatValue]['lastDate'] = $xmrdatas[$fiatValue]['lastDate']; + } + //print_r($new_array); + } + + - // Werte in die .json gespeichert - file_put_contents("coingecko.json", json_encode($new_sort_array)); + // Werte in die .json gespeichert + file_put_contents("coingecko.json", json_encode($new_array)); + file_put_contents("coingecko-original.json", json_encode($new_sort_array)); - // echo "
Sync.
"; + // echo "
Sync.
"; }//else{ - //echo "Keine Daten, noch zu früh!

"; - //echo "Gespeicherte Zeit: ".$xmrdatas['time']."
Aktuelle Zeit: ".$zeit."

Differenz: ".$zeit - $xmrdatas['time']."

"; + //echo "Keine Daten, noch zu früh!

"; + //echo "Gespeicherte Zeit: ".$xmrdatas['time']."
Aktuelle Zeit: ".$zeit."

Differenz: ".$zeit - $xmrdatas['time']."

"; //} ?> diff --git a/index.php b/index.php index 132efa9..02f5564 100644 --- a/index.php +++ b/index.php @@ -66,56 +66,56 @@ $time_cg = date("H:i:s", $api_cg->time); $time = $time_cg; // Holt die einzelnen Werte für die Berechnung -$BTC = $api_cg->btc; -$EUR = $api_cg->eur; -$USD = $api_cg->usd; -$CHF = $api_cg->chf; -$LTC = $api_cg->ltc; -$CAD = $api_cg->cad; -$AUD = $api_cg->aud; -$HKD = $api_cg->hkd; -$SGD = $api_cg->sgd; -$GBP = $api_cg->gbp; -$RUB = $api_cg->rub; -$ZAR = $api_cg->zar; -$TRY = $api_cg->try; -$JPY = $api_cg->jpy; -$PLN = $api_cg->pln; -$INR = $api_cg->inr; -$AED = $api_cg->aed; -$ETH = $api_cg->eth; -$UAH = $api_cg->uah; -$KRW = $api_cg->krw; -$BRL = $api_cg->brl; -$MYR = $api_cg->myr; -$CNY = $api_cg->cny; -$XAU = $api_cg->xau; -$XAG = $api_cg->xag; -$VND = $api_cg->vnd; -$VEF = $api_cg->vef; -$THB = $api_cg->thb; -$SAR = $api_cg->sar; -$SEK = $api_cg->sek; -$PKR = $api_cg->pkr; -$NOK = $api_cg->nok; -$LKR = $api_cg->lkr; -$MMK = $api_cg->mmk; -$HUF = $api_cg->huf; -$ILS = $api_cg->ils; -$KWD = $api_cg->kwd; -$NGN = $api_cg->ngn; -$NZD = $api_cg->nzd; -$PHP = $api_cg->php; -$IDR = $api_cg->idr; -$TWD = $api_cg->twd; -$ARS = $api_cg->ars; -$BDT = $api_cg->bdt; -$BHD = $api_cg->bhd; -$BMD = $api_cg->bmd; -$CLP = $api_cg->clp; -$CZK = $api_cg->czk; -$DKK = $api_cg->dkk; -$MXN = $api_cg->mxn; +$BTC = $api_cg->btc->lastValue; +$EUR = $api_cg->eur->lastValue; +$USD = $api_cg->usd->lastValue; +$CHF = $api_cg->chf->lastValue; +$LTC = $api_cg->ltc->lastValue; +$CAD = $api_cg->cad->lastValue; +$AUD = $api_cg->aud->lastValue; +$HKD = $api_cg->hkd->lastValue; +$SGD = $api_cg->sgd->lastValue; +$GBP = $api_cg->gbp->lastValue; +$RUB = $api_cg->rub->lastValue; +$ZAR = $api_cg->zar->lastValue; +$TRY = $api_cg->try->lastValue; +$JPY = $api_cg->jpy->lastValue; +$PLN = $api_cg->pln->lastValue; +$INR = $api_cg->inr->lastValue; +$AED = $api_cg->aed->lastValue; +$ETH = $api_cg->eth->lastValue; +$UAH = $api_cg->uah->lastValue; +$KRW = $api_cg->krw->lastValue; +$BRL = $api_cg->brl->lastValue; +$MYR = $api_cg->myr->lastValue; +$CNY = $api_cg->cny->lastValue; +$XAU = $api_cg->xau->lastValue; +$XAG = $api_cg->xag->lastValue; +$VND = $api_cg->vnd->lastValue; +$VEF = $api_cg->vef->lastValue; +$THB = $api_cg->thb->lastValue; +$SAR = $api_cg->sar->lastValue; +$SEK = $api_cg->sek->lastValue; +$PKR = $api_cg->pkr->lastValue; +$NOK = $api_cg->nok->lastValue; +$LKR = $api_cg->lkr->lastValue; +$MMK = $api_cg->mmk->lastValue; +$HUF = $api_cg->huf->lastValue; +$ILS = $api_cg->ils->lastValue; +$KWD = $api_cg->kwd->lastValue; +$NGN = $api_cg->ngn->lastValue; +$NZD = $api_cg->nzd->lastValue; +$PHP = $api_cg->php->lastValue; +$IDR = $api_cg->idr->lastValue; +$TWD = $api_cg->twd->lastValue; +$ARS = $api_cg->ars->lastValue; +$BDT = $api_cg->bdt->lastValue; +$BHD = $api_cg->bhd->lastValue; +$BMD = $api_cg->bmd->lastValue; +$CLP = $api_cg->clp->lastValue; +$CZK = $api_cg->czk->lastValue; +$DKK = $api_cg->dkk->lastValue; +$MXN = $api_cg->mxn->lastValue; // Lädt die Sprachdatei, nach der Sprache die im Browser eingestellt wurde if(array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)){