Last active
March 8, 2017 09:39
-
-
Save evo42/13976492bc443f960b5fe458e4dc5c1b to your computer and use it in GitHub Desktop.
Export a list of ATMs supporting BitATM ('barTAN' / 'smartCash') in Austria
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| // Export a list of ATMs supporting BitATM in Austria | |
| // | |
| // navigate to the ATM listing page: | |
| https://www.psa.at/karteninhaber/bankomatsuche/bankomatsuche-national/ergebnis/?tx_atmsearch_pi1%5B__referrer%5D%5B%40extension%5D=Atmsearch&tx_atmsearch_pi1%5B__referrer%5D%5B%40vendor%5D=TYPO3&tx_atmsearch_pi1%5B__referrer%5D%5B%40controller%5D=Atm&tx_atmsearch_pi1%5B__referrer%5D%5B%40action%5D=displayAtmSearchForm&tx_atmsearch_pi1%5B__referrer%5D%5Barguments%5D=YTowOnt949725be06d0290af79f75c756798c9d4cb5b63e1&tx_atmsearch_pi1%5B__trustedProperties%5D=a%3A1%3A%7Bs%3A10%3A%22searchData%22%3Ba%3A9%3A%7Bs%3A9%3A%22atmnumber%22%3Bi%3A1%3Bs%3A8%3A%22bankname%22%3Bi%3A1%3Bs%3A8%3A%22district%22%3Bi%3A1%3Bs%3A3%3A%22zip%22%3Bi%3A1%3Bs%3A8%3A%22zip_drop%22%3Bi%3A1%3Bs%3A4%3A%22city%22%3Bi%3A1%3Bs%3A9%3A%22city_drop%22%3Bi%3A1%3Bs%3A7%3A%22address%22%3Bi%3A1%3Bs%3A7%3A%22atmtype%22%3Bi%3A1%3B%7D%7D9ab20f6e4d382a7c71faf4ef1f6c0d7dba92b811&tx_atmsearch_pi1%5BsearchData%5D%5Batmnumber%5D=&tx_atmsearch_pi1%5BsearchData%5D%5Bbankname%5D=&tx_atmsearch_pi1%5BsearchData%5D%5Bdistrict%5D=ALL&tx_atmsearch_pi1%5BsearchData%5D%5Bzip%5D=&tx_atmsearch_pi1%5BsearchData%5D%5Bzip_drop%5D=0&tx_atmsearch_pi1%5BsearchData%5D%5Bcity%5D=&tx_atmsearch_pi1%5BsearchData%5D%5Bcity_drop%5D=0&tx_atmsearch_pi1%5BsearchData%5D%5Baddress%5D=&tx_atmsearch_pi1%5BsearchData%5D%5Batmtype%5D=ALL | |
| // | |
| // run this code in the browser developer console | |
| // | |
| */ | |
| // extract ATM list | |
| var atmList = []; | |
| var atmExport = 'AT-BitATM-list.json'; | |
| var atmType = {'barTan': '4', 'smartCash': '6'}; | |
| var count = {'total': 0, 'barTan': 0, 'smartCash': 0}; | |
| console.log('* * * * * * * * * * * * * * * * * * * * '); | |
| console.log('* ATM locations supporting BitATM in AT'); | |
| console.log('* * * * * * * * * * * * * * * * * * * * '); | |
| $($("#resulttable")[0].config.rowsCopy).each(function() { | |
| var atm = {}; | |
| atm.id = this[0].cells[0].textContent; | |
| atm.atm_type = this[0].cells[5].textContent; | |
| atm.name = this[0].cells[1].textContent; | |
| atm.zip = this[0].cells[2].textContent; | |
| atm.city = this[0].cells[3].textContent; | |
| atm.street = this[0].cells[4].textContent; | |
| atm.bitcash = false; | |
| if (atm.id.substr(-atmType.barTan.length) == atmType.barTan) { | |
| count.barTan++; | |
| atm.bitcash = 'barTan'; | |
| } | |
| if (atm.id.substr(-atmType.smartCash.length) == atmType.smartCash) { | |
| count.smartCash++; | |
| atm.bitcash = 'smartCash'; | |
| } | |
| atmList.push(atm); | |
| count.total++; | |
| }); | |
| console.log('# ' + count.total + ' bank ATM in total'); | |
| console.log('# ' + (count.barTan + count.smartCash) + ' supporting BitATM'); | |
| console.log(' ' + count.barTan + ' barTAN'); | |
| console.log(' ' + count.smartCash + ' smartCash'); | |
| console.log('* * * * * * * * * * * * * * * * * * * * '); | |
| console.log('* Download ' + atmExport + ' ...'); | |
| console.log('* * * * * * * * * * * * * * * * * * * * '); | |
| console.save(atmList, atmExport); | |
| /* | |
| // helper stuff | |
| // console.save(data, 'filename.json') | |
| // http://stackoverflow.com/questions/11849562 | |
| */ | |
| !function(e){e.save=function(o,n){if(!o)return void e.error("Console.save: No data");n||(n="console.json"),"object"==typeof o&&(o=JSON.stringify(o,void 0,4));var t=new Blob([o],{type:"text/json"}),a=document.createEvent("MouseEvents"),d=document.createElement("a");d.download=n,d.href=window.URL.createObjectURL(t),d.dataset.downloadurl=["text/json",d.download,d.href].join(":"),a.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),d.dispatchEvent(a)}}(console); |
Author
evo42
commented
Mar 8, 2017

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment