├── LICENSE ├── README.md └── Code.gs /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Nicolò Paternoster 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | altcoin-google-spreadsheet 2 | ========================== 3 | 4 | Altcoin price tracker into a google spreadsheet. 5 | 6 | ![Livedemoscreehshot](http://www.lize.it/up/altcoin_screenshot.png) 7 | 8 | #How does it work? 9 | Try the [Live Demo](http://goo.gl/RvCxne ) . 10 | 11 | It scrapes data from http://coinmarketcap.com . The data is contained in the sheet called *Price Ticker*. 12 | 13 | It all goes down to the magic done by importHtml() function with some tricks and parsing. 14 | ``` 15 | =importHtml("http://coinmarketcap.com/?"& year(now()) & month(now()) & day(now()) & hour(now()),"table",1) 16 | ``` 17 | Then I made some magic to be sure to keep coins in the same order and to parse the data. 18 | 19 | #How to use it 20 | 21 | There are a few steps needed for having this work on your own spreadsheet: 22 | - Make a copy of the [Live Demo](http://goo.gl/RvCxne ) and open it 23 | - Past the content of [Code.gs](https://github.com/adv0r/altcoin-google-spreadsheet/blob/master/Code.gs) into a new script 24 | - Create a new trigger that calls the function *transferValue()* every 5 minutes 25 | - Done 26 | 27 | If you need help in setting this up, I'll be glad to help. Mail *nico@botcoin.io* and attach some coins if you want to get out of the noise ;) . 28 | 29 | #TIPS: 30 | ## Help this project if you think that this project helps you 31 | - BTC 1NgDPjxNWxTUK9eUExEmAGj4mtiMLGFvYr 32 | 33 | #Discuss it 34 | 35 | [bitcointalk](https://bitcointalk.org/index.php?topic=368226) 36 | 37 | [reddit](http://www.reddit.com/r/CryptoMarkets/comments/1spnk3/online_spreadsheet_with_altcoins_live_data/) 38 | -------------------------------------------------------------------------------- /Code.gs: -------------------------------------------------------------------------------- 1 | /* Author : nico@botcoin.io 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) 2013 Nicolò Paternoster 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | this software and associated documentation files (the "Software"), to deal in 9 | the Software without restriction, including without limitation the rights to 10 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | the Software, and to permit persons to whom the Software is furnished to do so, 12 | subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | */ 24 | function parseUsd(raw) //parse the value of 1 coin 25 | { 26 | var endindex= raw.lastIndexOf(".") -1; 27 | 28 | return raw.substring(1,endindex); 29 | } 30 | 31 | function parseBtc(raw) //parse the value of 1 coin 32 | { 33 | var startindex = raw.lastIndexOf(".") -1; 34 | var endindex = raw.length -3; 35 | return raw.substring(startindex,endindex); 36 | } 37 | 38 | function getLineOf(coin) //Gets the line at which to look at the price of the coin from coinmarketcap html scrape 39 | { 40 | var rowNumber = -1; 41 | var sheetCoinMarket = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('CoinmarketCAPtemporized'); 42 | 43 | var dataCoinMarket = sheetCoinMarket.getDataRange().getValues(); // read all data in the sheet 44 | 45 | for(n=1;n