draft/getSinopacATM.R

getSinopacATM <- function(){
  
  URL="https://mma.sinopac.com/Share/CustomerService/ATMListJson.ashx"
  res <- POST(URL, body=list(QueryType='1'))
  #, body=list(QueryType="1")
  #,country='%E8%AB%8B%E9%81%B8%E6%93%87')
  res2 <- content(res,as= "text")
  res2<-rjson::fromJSON(res2)
  res2<-unlist(res2)
  dist<-matrix(data=res2,ncol=32,byrow=TRUE)
  Title = c("gis_Y","gis_X","id","groupno","atmno","store_nm",
            "photos.height","photos.width", "addr", "reference","types1" ,"types2", "tel_no",
            "atmtype" ,"locno","locname","service","atmstatus",           
            "saving","withdrawntd100","withdrawntd1000","withdrawcny","withdrawusd",          
            "withdrawjpy","withdrawhkd","curr1","curr2","sATM_24_service",
            "lat","lng","updatetime","Header")
  colnames(dist)=Title
  brand_nm='永豐銀行ATM'
  store_info<-cbind(brand_nm,dist)
  as.data.frame(store_info, stringsAsFactors = FALSE)
}
leoluyi/CRMaddress documentation built on May 21, 2019, 5:08 a.m.