个别网站搜索链接跳转制作(例如茶杯狐)

想把有用的网站搜索链接添加到自己站点,但是目标网站链接不好写的情况:

百度 https://www.baidu.com/s?wd=,茶杯狐https://cupfox.app/s/

没有?wd=,往搜索框里不好放。可以用下面源码进行跳转。

源码:

<html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="robots" content="noindex, nofollow" />
<meta name="applicable-device" content="pc,mobile">
<meta name="HandheldFriendly" content="true" />
<title>页面加载中...</title>
<script>
let siteweb=window.location.search,
key=siteweb.substring(1,siteweb.indexOf("=")),
value=siteweb.substring(siteweb.indexOf("=")+1,siteweb.length);
switch (key) {
  case 'weixin':
    target = 'https://weixin.sogou.com/weixin?type=2&query='+value;
    break;
  case 'yhq':
    target = 'https://quan.yumus.cn/?r=/l&kw='+value+'&sort=0';
    break;
  case 'cbh':
    target = 'https://cupfox.app/s/'+value;
    break;
  case 'pex':
    target = 'https://www.pexels.com/zh-cn/search/'+value+'/';
    break;
  default:
    break;
}
location.href = target;
</script>
</head>
<body>
</body>
</html>

把源码保存服务器或者主机,命名xxx.html即可。调用方法(例):文件地址+?cbh=

© 版权声明
THE END
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容