Midwesterner Posted December 20, 2017 Share Posted December 20, 2017 (edited) Hi all, Sometimes I just want a quick reference to my XRP portfolio value & profit/loss value thereon without logging into a wallet or exchange! So I threw together a quick page using HTML/Javascript and wanted to share it here in case anyone else wants to use it. This is for XRP/USD. Code and instructions are below. I am using the XRP/USD value reflected at https://xrpcharts.ripple.com/#/markets/XRP/USD:rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B? and using the Ripple API for Bitstamp from https://data.ripple.com/v2/exchanges/XRP/USD+rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B? Anyhow, free to use if useful... ======================================================================== INSTRUCTIONS: 1. Copy the entire code below into Notepad or another text editor. 2. In the copied code , change NNN.NNN (located in two places) with the amount of XRP you hold. For example, you would change NNN.NNN to 719.251 if you own 719.251 tokens. 3. In copied code, change XXX.XX to the amount you paid for your total amount of tokens. For example, you would change XXX.XX to 800.50 if you paid a total of $800.50 for the 719.251 tokens. 4. Save code from Notepad as an HTML file. 5. Open saved HTML page. 6. Page does not auto-refresh so you need to refresh page yourself as needed or just reopen page. CODE: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script> <script> $(document).ready(function() { $.getJSON('https://data.ripple.com/v2/exchanges/XRP/USD+rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B?limit=1&descending=true', function(data) { document.write("<br>"+"CURRENT XRP/USD RATE (per Bitstamp as reported at Ripple.com) = "+(data.exchanges[0]['rate'])+"<br><br>"+"MY PORTFOLIO VALUE = $"+(data.exchanges[0]['rate']*(NNN.NNN)).toFixed(2)+"<br><br>"+"MY PROFIT/LOSS = $"+((data.exchanges[0]['rate']*(NNN.NNN)-XXX.XX)).toFixed(2)); }); }); </script> </head> <body> </body> </html> Edited December 20, 2017 by Midwesterner pucksterpete and xrp_moonjet 1 1 Link to comment Share on other sites More sharing options...
Midwesterner Posted December 20, 2017 Author Share Posted December 20, 2017 And if you want to make a shortcut of your HTML page and pin it to your taskbar like an app - https://www.tenforums.com/tutorials/4636-pin-taskbar-folder-drive-windows-10-a.html Link to comment Share on other sites More sharing options...
Midwesterner Posted December 20, 2017 Author Share Posted December 20, 2017 FYI - Looks like Ripple's exchanges URL is down or something - https://data.ripple.com/v2/exchanges (In case someone tried this recently and no data was pulled from the RIPPLE JSON). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now