getcvs
Version:
getcvs @manager-center
32 lines (20 loc) • 740 B
JavaScript
const axiosService = require('./axios.service');
let getStores = async (city, area) => {
try {
let api = 'https://api.map.com.tw/net/familyShop.aspx?searchType=ShopList&type=&city=' + encodeURI(city) + '&area=' + encodeURI(area) + '&road=&fun=showStoreList&key=6F30E8BF706D653965BDE302661D1241F8BE9EBC';
let headers = { 'Referer': 'https://www.family.com.tw/marketing/inquiry.aspx' }
let body = await axiosService.get(api, headers);
try {
var str = body.slice(14);
str = str.slice(0, -1);
return JSON.parse(str);
} catch (e) {
throw e;
}
} catch (e) {
throw e;
};
}
module.exports = {
getStores
}