Author

Topic: Need some Wordpress API help (Read 1628 times)

full member
Activity: 220
Merit: 100
February 26, 2015, 09:20:02 AM
#14
Hello, can anyone help how to put this to Wordpress site?

http://blockexperts.com/api?coin=brit&action=getheight
member
Activity: 84
Merit: 10
March 14, 2014, 07:22:02 PM
#13
That worked! Thanks so much for all the help.

One more question. Right now, the prices load and the decimal place is always random. For BTC sometimes it displayed 620.2 if it's 620.20, and for LTC it will display things like 16.7893.

Is there a way to make it so there's always 2 decimal places?

There sure is -- with the toFixed() method. The LTC code becomes:

Code:




And the BTC code is now:

Code:



member
Activity: 90
Merit: 10
March 14, 2014, 07:10:23 PM
#12
That worked! Thanks so much for all the help.

One more question. Right now, the prices load and the decimal place is always random. For BTC sometimes it displayed 620.2 if it's 620.20, and for LTC it will display things like 16.7893.

Is there a way to make it so there's always 2 decimal places?
member
Activity: 84
Merit: 10
March 14, 2014, 05:04:23 PM
#11
Thanks again for the help. Just sent a tip. 

I tried that, but it returns "$undefined"

I appreciate it!

I managed to get the BTC-E API working; try this:

Code:



member
Activity: 90
Merit: 10
March 14, 2014, 04:30:01 PM
#10
Thanks again for the help. Just sent a tip. 

I tried that, but it returns "$undefined"
member
Activity: 84
Merit: 10
March 14, 2014, 02:33:48 PM
#9
Thanks for the help to all of you. I got the BTC call working, but now can't get the Litecoin one working. I tried copying the BTC code and changing it exactly to BTC-e, but it didn't work. I also tried combining the Java functions together which also didn't work.

I tried:
Code:


I also tried like this and couldn't get it to work
Code:


with this code

Code:

Litecoin





I tried the alert test and the Java is loading, it just won't get the Litecoin price.

Please post your tipping addresses so I can send some Bitcoin.



Try this for the LTC price:

Code:



My coffee fund address is 1Gk8nqr8W3FadcdawMrGzPXFnXcAZ9k6vL
member
Activity: 90
Merit: 10
March 14, 2014, 02:09:47 PM
#8
Thanks for that! It looks similar to what should work as far as I know, but it didn't display anything when I added it. I also tried changing it to this:

Code:


[b]
[/b]


But that also didn't work.

I'd be happy to tip you for both if I can get them working.

May i know how did you tried to added it?

And did you tried bitcoin ticker for wordpress. You can just download widget, and add widget to your website in simple steps.
I want to customize the look of the price. Also, I want the price in the header and not in a widget.
member
Activity: 90
Merit: 10
March 14, 2014, 11:40:51 AM
#7
Thanks for the help to all of you. I got the BTC call working, but now can't get the Litecoin one working. I tried copying the BTC code and changing it exactly to BTC-e, but it didn't work. I also tried combining the Java functions together which also didn't work.

I tried:
Code:


I also tried like this and couldn't get it to work
Code:


with this code

Code:

Litecoin





I tried the alert test and the Java is loading, it just won't get the Litecoin price.

Please post your tipping addresses so I can send some Bitcoin.

member
Activity: 84
Merit: 10
March 14, 2014, 10:30:40 AM
#6
Thanks for that! It looks similar to what should work as far as I know, but it didn't display anything when I added it. I also tried changing it to this:

Code:


[b]
[/b]


But that also didn't work.

I'd be happy to tip you for both if I can get them working.

Can you open the developer console of your browser and take a screenshot? It sounds like you might not be loading jquery, although I'm not 100% sure.
newbie
Activity: 27
Merit: 0
March 14, 2014, 06:36:59 AM
#5
Thanks for that! It looks similar to what should work as far as I know, but it didn't display anything when I added it. I also tried changing it to this:

Code:


[b]
[/b]


But that also didn't work.

I'd be happy to tip you for both if I can get them working.
Try to write
alert("test"); after the document.ready line like that:

Code:


[b]
[/b]

See if the alert popup will appear on page loading. If not, then this javascript code is not included in your page
What browser do you use, Chrome? Try opening Inspect Element (mose right-click) and see if there are any errors while loading website.
newbie
Activity: 56
Merit: 0
March 14, 2014, 05:48:40 AM
#4
Thanks for that! It looks similar to what should work as far as I know, but it didn't display anything when I added it. I also tried changing it to this:

Code:


[b]
[/b]


But that also didn't work.

I'd be happy to tip you for both if I can get them working.

May i know how did you tried to added it?

And did you tried bitcoin ticker for wordpress. You can just download widget, and add widget to your website in simple steps.
member
Activity: 90
Merit: 10
March 14, 2014, 02:43:02 AM
#3
Thanks for that! It looks similar to what should work as far as I know, but it didn't display anything when I added it. I also tried changing it to this:

Code:


[b]
[/b]


But that also didn't work.

I'd be happy to tip you for both if I can get them working.
member
Activity: 84
Merit: 10
March 13, 2014, 05:16:34 PM
#2
One easy way to do it would be to have the clients load the prices themselves, using javascript to get the data and put it where you want. An example is included below, just save the code as HTML and open it in your browser. This kind of thing is easy to just drop into an existing page. I set it up with the bitcoin price, if you tip me for that, I can help with the litecoin one also.

Code:



member
Activity: 90
Merit: 10
March 13, 2014, 03:18:23 PM
#1
I'm building a new Crypto site, and want to call the price of Bitcoin and Litecoin using APIs.

I'd like to call the price for Bitcoin from this API https://bitcoinaverage.com/api.htm

And the Litecoin price from here: https://btc-e.com/api/documentation

How would I call this data on my Wordpress site?

Willing to send a tip to anyone who can help me get it up and running. It's for a new crypto website I am launching soon.
Jump to:
© 2020, Bitcointalksearch.org