Author

Topic: Html. API info pull (Read 1155 times)

legendary
Activity: 1358
Merit: 1001
https://gliph.me/hUF
March 02, 2015, 06:13:17 AM
#4
@Morblias came up with a solution for python to write the html: http://pastebin.com/MGu1iBkH (scroll about half way down). The result is something like this: http://192.227.139.229/ . It's a bit dated, so might need some adjustments.


A very basic hack could be to pipe the output of the RPC calls to a simple HTML file. For example getinfo command:
Code:
 
  Bitcoin Node
{
"version" : 100000,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 0.26397973,
"blocks" : 345815,
"timeoffset" : 0,
"connections" : 8,
"proxy" : "",
"difficulty" : 46684376316.86029053,
"testnet" : false,
"keypoololdest" : 1397008447,
"keypoolsize" : 100,
"unlocked_until" : 0,
"paytxfee" : 0.00001000,
"relayfee" : 0.00001000,
"errors" : ""
}

Then have a cronjob to run it every x minutes etc. Have another cronjob just before to remove the old file and create a new one with the HTML3.2 header. Probably you'll want to put it all in one script. It won't look pretty, but the info is there.


PS: Picked HTML3.2 because the specs say:
Quote
In practice, the HTML, HEAD and BODY start and end tags can be omitted from the markup as these can be inferred in all cases by parsers conforming to the HTML 3.2 DTD.
legendary
Activity: 1876
Merit: 1475
March 01, 2015, 05:32:50 PM
#3
Pure HTML? No, definitely no.

However you can do this:

- Install the wallet and enable RPC.
- Write a simple PHP script that connects via RPC (using jsonrpcphp for example) and displays it as json.
- Write a simple javacript code using jQuery that connects to that PHP and dynamically updates the HTML.
hero member
Activity: 728
Merit: 500
March 01, 2015, 05:29:57 PM
#2
No.

HTML is a language for website structure and layout, it doesn't provide features for interactivity. For that, you need to use a scripting language such as JavaScript (client side) or PHP (server side).
legendary
Activity: 1540
Merit: 1002
February 28, 2015, 04:33:29 PM
#1
i couldnt what to call this but here goes

is there a way using HTML code (like in wordpress) to pull and display wallet info on a website.

so website would connect to the server running the wallet and get info such as connections, last block, online/offline
Jump to: