心知天气网页调用源码

最近给我的博客新加了天气预报功能,首先需要注册心知天气账号https://www.seniverse.com/widget/create

自动生成安装代码

将其复制到“设置”->“页脚Html代码”中

<script>(function(T,h,i,n,k,P,a,g,e){g=function(){P=h.createElement(i);a=h.getElementsByTagName(i)[0];P.src=k;P.charset="utf-8";P.async=1;a.parentNode.insertBefore(P,a)};T["ThinkPageWeatherWidgetObject"]=n;T[n]||(T[n]=function(){(T[n].q=T[n].q||[]).push(arguments)});T[n].l=+new Date();if(T.attachEvent){T.attachEvent("onload",g)}else{T.addEventListener("load",g,false)}}(window,document,"script","tpwidget","//widget.seniverse.com/widget/chameleon.js"))</script>
<script>tpwidget("init", {
    "flavor": "bubble",
    "location": "WWE0TGW4PX6N",
    "geolocation": "enabled",
    "position": "top-right",
    "margin": "10px 10px",
    "language": "zh-chs",
    "unit": "c",
    "theme": "chameleon",
    "uid": "U7723B164C",
    "hash": "554f0133ab6532c8a7724fcc5cc06361"
});
tpwidget("show");</script>
原文地址:https://www.cnblogs.com/wkfvawl/p/9412847.html