(share_url, callback)
| 164 | } |
| 165 | |
| 166 | function requestPrice(share_url, callback) { |
| 167 | const options = { |
| 168 | url: "https://apapia-history.manmanbuy.com/ChromeWidgetServices/WidgetServices.ashx", |
| 169 | headers: { |
| 170 | "Content-Type": "application/x-www-form-urlencoded;charset=utf-8", |
| 171 | "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 - mmbWebBrowse - ios" |
| 172 | }, |
| 173 | body: "methodName=getHistoryTrend&p_url=" + encodeURIComponent(share_url) |
| 174 | } |
| 175 | $tool.post(options, function (error, response, data) { |
| 176 | if (!error) { |
| 177 | callback(JSON.parse(data)); |
| 178 | if (consoleLog) console.log("Data:\n" + data); |
| 179 | } else { |
| 180 | callback(null, null); |
| 181 | if (consoleLog) console.log("Error:\n" + error); |
| 182 | } |
| 183 | }) |
| 184 | } |
| 185 | |
| 186 | function dateFormat(cellval) { |
| 187 | const date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), 10)); |
no test coverage detected