Bitcoin Forum
November 12, 2024, 07:32:07 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [HTML] Display current bitcoin price - Help?!  (Read 5569 times)
blindfaith (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


www.coincloud.tk :)


View Profile
June 18, 2013, 12:32:41 PM
 #1

Hello BCT.org community! As always, apologies if this is in the wrong section! Tongue - I'm making a little website and wish to display the current average price of a BTC either from a blockchain/btce/mt gox ticker but am useless as putting together any code I find.. I'm hoping to display either in text or a simple image the price of bitcoin, which will auto-update when the source does..


I'm currently using simple drag and drop site makers but they allow custom HTML and hope I can copy and paste something and edit it how I like.
(not looking to get slated for this..)

I'd be very grateful of anyone who has a good knowledge of html and can write up a basic code I can copy and paste!

:p prize for the most to the point answer! Smiley


The output should resemble:

[1 BTC = $101 / £65 / €76]
 OR
[1 BTC = $101]
[1 BTC = £65]
1 BTC =  €76]

Thank you!


A Ship Is Safe In The Harbor,  But That's Not What Ships Are For | PrimeDice.com | The New Way To Roll
~ 3 BTC Raffle! Free Entry! > here! .. Also check out my own little project here & find out how to earn mBTC by chatting here ~ Smiley
CrownCloud
Sr. Member
****
Offline Offline

Activity: 467
Merit: 250


View Profile
June 18, 2013, 12:34:13 PM
 #2

You'll need PHP to parse out the price from the json ticker from the bitcoin exchanges.

CrownCloud - Internet Services
Dedicated servers, OpenVZ and KVM based VPSes and  in 4 locations. (We accept Bitcoin !)
http://crowncloud.net/
whydifficult
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
June 18, 2013, 12:40:15 PM
 #3

You don't need a server side language like PHP and no drag and drop site maker I know of supports custom server side stuff. You also can't do it in HTML as it is no programming language but a markup language.

I would check if they support javascript snippets (or script tags). If Javascript (JS) is not allowed the only other option I can think of is to load an external image with the price embedded in the picture. This means that you need someone that will parse the price every minute or something and embed it in a picture.

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
blindfaith (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


www.coincloud.tk :)


View Profile
June 18, 2013, 12:45:26 PM
 #4

Sad Ah, nothing I want to do is straight forward, heh..
I don't suppose anyone knows of any website offering a c+p .. premade ticker thing? Tongue
Else I will find a different host who are dumbass friendly but offer php/java Tongue
Ty for the replies also! Smiley

A Ship Is Safe In The Harbor,  But That's Not What Ships Are For | PrimeDice.com | The New Way To Roll
~ 3 BTC Raffle! Free Entry! > here! .. Also check out my own little project here & find out how to earn mBTC by chatting here ~ Smiley
whydifficult
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
June 18, 2013, 01:00:28 PM
 #5

Sad Ah, nothing I want to do is straight forward, heh..
I don't suppose anyone knows of any website offering a c+p .. premade ticker thing? Tongue
Else I will find a different host who are dumbass friendly but offer php/java Tongue
Ty for the replies also! Smiley

I don't think it will be easy as drag/drop unfortunately.

Do note that I was talking about Javascript which is completely different from java, the first one does not need to be supported by the website hoster (only allowed because of security if you have something like a drag and drop websitemaker) and the second thing is something they need to install, support and offer to you.

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
blindfaith (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


www.coincloud.tk :)


View Profile
June 18, 2013, 01:07:55 PM
 #6

Okay, It seems it will probably be better in the long-run to switch host now before I want to add anything else I can't..
I'll scour around for pre-made php version's or something but I'll probably get stuck again Tongue Thank you for now!

A Ship Is Safe In The Harbor,  But That's Not What Ships Are For | PrimeDice.com | The New Way To Roll
~ 3 BTC Raffle! Free Entry! > here! .. Also check out my own little project here & find out how to earn mBTC by chatting here ~ Smiley
domob
Legendary
*
Offline Offline

Activity: 1135
Merit: 1170


View Profile WWW
June 18, 2013, 01:18:50 PM
 #7

I can write up either a PHP or JavaScript version, if you like.  Of course it depends on your hosting provider, whether or not that will be useful to you.  If you promise me a small BTC donation and let me know what of those languages you want, I'll do it today in the evening (according to CEST time). Wink

Use your Namecoin identity as OpenID: https://nameid.org/
Donations: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS | GPG 0xA7330737
MA5H3D
Member
**
Offline Offline

Activity: 99
Merit: 10


View Profile
June 18, 2013, 02:24:06 PM
 #8

Two pages, you can change the refresh interval in index.php

Page 1 = index.php -

<!DOCTYPE html>
<head>
      <title>Bitcoin Price</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
      <meta http-equiv="Pragma" content="no-cache">
      <meta http-equiv="Expires" content="0">

      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
     
      <script>
         var auto_refresh = setInterval(
         function()
         {$('.btc-price').load('gox.php');}, 10000);
      </script>
</head>

<body>
<div class="btc-price">Wait 10 Seconds..</div>
</body>

</html>


Page 2 = gox.php -

<?php
header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.

$data = file_get_contents("https://data.mtgox.com/api/2/BTCUSD/money/ticker_fast");
$data = json_decode($data, true);
$spot_last = $data['data']['last']['value'];
print_r($spot_last);
?>

Try That.
botsofbitcoin
Member
**
Offline Offline

Activity: 62
Merit: 10



View Profile WWW
June 19, 2013, 04:57:39 PM
 #9

This probably isn't exactly what you're looking for but it does show the current (USD) price and also a poll for whether you think the price will be up, down or neutral over the next 6 months.

http://bitcoinsentiment.com/?id=1026

It's a great project and has the potential to be a really useful trading indicator - and the more people use it the better it gets.

The widget code is:

Code:
<iframe src="http://bitcoinsentiment.com/w003.php?id=604718563&textcolor=444444" style="border-style: solid; border-color: #cccccc; width: 165px; height: 150px; background-color: #ffffff;"></iframe>

See my localbitcoins ads here: https://localbitcoins.com/accounts/profile/botsofbitcoin/?ch=2mk
Visit Bots of Bitcoin here: http://www.botsofbitcoin.com/
Follow on Twitter: @botsofbitcoin
whydifficult
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile WWW
June 21, 2013, 09:40:20 AM
 #10

Not sure if you are still in need, but I just came across this image widget:



You can just add an image with this link to the site:

https://btcticker.appspot.com/mtgox/1.00btc.png

and it will display the current price in USD.

I don't know how reliable this widget is though.

Gekko a nodejs bitcoin trading bot!
Realtime Bitcoin Globe - visualizing all transactions and blocks
Tip jar (BTC): 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
blindfaith (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10


www.coincloud.tk :)


View Profile
June 22, 2013, 06:05:04 PM
 #11

Thank you for all the help guys!
The last post is the one I had in mind - I had came across that site before and lost it!

THAAAAAAAAANK YOOOOOOOOOOOOOOOU!  Grin Cheesy

I'll send everyone who pitched in some code a little donation if you pm me your address Smiley

A Ship Is Safe In The Harbor,  But That's Not What Ships Are For | PrimeDice.com | The New Way To Roll
~ 3 BTC Raffle! Free Entry! > here! .. Also check out my own little project here & find out how to earn mBTC by chatting here ~ Smiley
Blisk
Sr. Member
****
Offline Offline

Activity: 412
Merit: 250


View Profile
March 08, 2014, 08:42:17 AM
 #12

can someone help me pull data from this site in html?
withouth commas and quotes
https://api.bitcoinaverage.com/ticker/global/AED


and this one
https://api.bitcoinaverage.com/ticker/global/USD/last

daybyter
Legendary
*
Offline Offline

Activity: 965
Merit: 1000


View Profile
March 08, 2014, 07:49:57 PM
 #13

This should help you:

http://stackoverflow.com/questions/9922101/get-json-data-from-external-url-and-display-a-particular-value-by-injecting-it-i

Blisk
Sr. Member
****
Offline Offline

Activity: 412
Merit: 250


View Profile
March 08, 2014, 08:32:40 PM
 #14


Thanks I already try that.
I am trying to get those data on forum on portal page with <iframe......> </iframe> as custom block
but not working.

I also am trying to get those data by BBCode for forum... also didn't manage to work

but have no knowledge of php or html...

daybyter
Legendary
*
Offline Offline

Activity: 965
Merit: 1000


View Profile
March 08, 2014, 09:26:04 PM
 #15

Problem will be then, that you have to understand the code of the forum software you are using.

Blisk
Sr. Member
****
Offline Offline

Activity: 412
Merit: 250


View Profile
March 09, 2014, 09:00:35 AM
 #16

Problem will be then, that you have to understand the code of the forum software you are using.


I use phpbb3 and I understand how to use BBCode

daybyter
Legendary
*
Offline Offline

Activity: 965
Merit: 1000


View Profile
March 09, 2014, 10:45:02 AM
 #17

https://www.phpbb.com/community/viewtopic.php?f=46&t=2157750

Blisk
Sr. Member
****
Offline Offline

Activity: 412
Merit: 250


View Profile
March 09, 2014, 11:28:41 AM
 #18

will try this, thank you

Pages: [1]
  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!