当前位置:首页 > 渗透破解 > 正文内容

jquery天气接口的简单介绍

hacker2年前 (2023-01-28)渗透破解153

本文目录一览:

天气预报API接口是什么?

天气预报API接口是气象服务商为客户提供服务的唯一接口。拿墨迹赤必为例,跟客户充分沟通后了解客户的实际需求,从而对现有的数据进行调整,符合客户的需求形成API接口,让客户接入,这样就形成了一个完整的服务。所以说API接口并不是一个很神秘的东西,只不过是企业和客户之间的一条服务纽带。

有哪些免费开放且收录城市较完整的天气 API 接口

一 天气预报

国内的天气预报数据,主要是国家气象局和国外两个来源(指数据来源)。

国外方面主要是雅虎(XML格式,谷歌已经停掉了自家的天气API);

国内数据由国家气象局提供( *** ON格式)。

在知乎看到过一篇专业人士评论,雅虎可以提供全球范围的且非常精细的天气数据(小时级更新),但主要是通过计算机自动生成。而国家气象局则是各地经验丰富的专家人士结合计算机综合分析得出,在准确性上更胜一筹。我就这样信了!

国家气象局接口资源及用法

气象局的天气预报主页:移动版普通版 ,仔细挖掘这两个地址可以发现很多好东西哦。

特点:接口多,来自和都有,次数不限制,服务稳定,功能全面,优先推荐。

1. 实时天气接口

有多个接口,好像差别不大:

实时天气1:

实时天气2:

实时天气3(带时间戳):

2. 一周天气预报接口

7天预报数据 URL:

该接口来源气象局移动版网站,目测数据最为精确,详细接口格式如下:

{"c":{"c1":"101010100","c2":"beijing","c3":"北京","c4":"beijing","c5":"北京","c6":"beijing","c7":"北京","c8":"china","c9":"中国","c10":"1","c11":"010","c12":"100000","c13":"116.391","c14":"39.904","c15":"33","c16":"AZ9010","c17":"+8"},

"f":{"f1":

[

{"fa":"01","fb":"03","fc":"10","fd":"5","fe":"0","ff":"0","fg":"0","fh":"0","fi":"06:21|17:40"},

{"fa":"07","fb":"07","fc":"19","fd":"12","fe":"0","ff":"0","fg":"0","fh":"0","fi":"06:22|17:38"},

{"fa":"02","fb":"00","fc":"15","fd":"5","fe":"8","ff":"8","fg":"3","fh":"1","fi":"06:23|17:37"},

{"fa":"00","fb":"00","fc":"16","fd":"4","fe":"0","ff":"0","fg":"0","fh":"0","fi":"06:24|17:35"},

{"fa":"00","fb":"00","fc":"18","fd":"7","fe":"0","ff":"0","fg":"0","fh":"0","fi":"06:25|17:34"},

{"fa":"00","fb":"01","fc":"18","fd":"8","fe":"0","ff":"0","fg":"0","fh":"0","fi":"06:26|17:32"},

{"fa":"01","fb":"01","fc":"16","fd":"6","fe":"0","ff":"0","fg":"0","fh":"0","fi":"06:27|17:31"}],

"f0":"201310121100"}}

详细接口分析如下:

//格式说明

var format={fa:图片1,fb:图片2,fc:温度1,fd:温度2,fe:风向1,ff:风向2,fg:风力1,fh:风力2,fi:日出日落};

//定义天气类型

var weatherArr={"00":"晴","01":"多云","02":"阴","03":"阵雨","04":"雷阵雨","05":"雷阵雨伴有冰雹","06":"雨夹雪","07":"小雨","08":"中雨","09":"大雨","10":"暴雨","11":"大暴雨","12":"特大暴雨","13":"阵雪","14":"小雪","15":"中雪","16":"大雪","17":"暴雪","18":"雾","19":"冻雨","20":"沙尘暴","21":"小到中雨","22":"中到大雨","23":"大到暴雨","24":"暴雨到大暴雨","25":"大暴雨到特大暴雨","26":"小到中雪","27":"中到大雪","28":"大到暴雪","29":"浮尘","30":"扬沙","31":"强沙尘暴","53":"霾","99":""};

//定义风向数组

var fxArr={"0":"无持续风向","1":"东北风","2":"东风","3":"东南风","4":"南风","5":"西南风","6":"西风","7":"西北风","8":"北风","9":"旋转风"};

//定义风力数组

var flArr={"0":"微风","1":"3-4级","2":"4-5级","3":"5-6级","4":"6-7级","5":"7-8级","6":"8-9级","7":"9-10级","8":"10-11级","9":"11-12级"};

6天预报数据 URL:

该接口来源 *** ,应该是一个流传比较久的接口,大发现准确性和稳定性可能不稳定。接口分析如下:

{"weatherinfo":{

#基本信息

"city":"北京","city_en":"beijing","date_y":"2013年9月24日","date":"","week":"星期二","fchh":"11","cityid":"101010100",

#6天温度范围

"temp1":"22℃~11℃","temp2":"25℃~11℃","temp3":"26℃~13℃","temp4":"25℃~15℃","temp5":"25℃~16℃","temp6":"24℃~16℃",

#6天温度范围(华氏)

"tempF1":"71.6℉~51.8℉","tempF2":"77℉~51.8℉","tempF3":"78.8℉~55.4℉","tempF4":"77℉~59℉","tempF5":"77℉~60.8℉","tempF6":"75.2℉~60.8℉",

#6天天气

"weather1":"多云转晴","weather2":"晴","weather3":"晴","weather4":"晴转多云","weather5":"阴转阵雨","weather6":"多云",

#6天天气图示(每天2张)

"img1":"1","img2":"0","img3":"0","img4":"99","img5":"0","img6":"99","img7":"0","img8":"1","img9":"2","img10":"3","img11":"1","img12":"99",

"img_single":"1",

#6天天气图示文字(每天2)

"img_title1":"多","img_title2":"晴","img_title3":"晴","img_title4":"晴","img_title5":"晴","img_title6":"晴","img_title7":"晴","img_title8":"多云","img_title9":"阴","img_title10":"阵雨","img_title11":"多云","img_title12":"多云",

"img_title_single":"多云",

#6天风

"wind1":"北风3-4级转微风","wind2":"微风","wind3":"微风","wind4":"微风","wind5":"微风","wind6":"微风",

"fx1":"北风","fx2":"微风",

#6天风力情况

"fl1":"3-4级转小于3级","fl2":"小于3级","fl3":"小于3级","fl4":"小于3级","fl5":"小于3级","fl6":"小于3级",

#24小时内

"index":"较冷","index_d":"建议着大衣、呢外套加毛衣、卫衣等服装。体弱者宜着厚外套、厚毛衣。因昼夜温差较大,注意增减衣服。",

#48小时内

"index48":"较舒适","index48_d":"建议着薄外套或牛仔衫裤等服装。年老体弱者宜着夹克衫、薄毛衣等。昼夜温差较大,注意适当增减衣服。",

#紫外 洗车 旅游 舒适指数 晨练 晾晒 过敏

"index_uv":"弱",

"index48_uv":"强",

"index_xc":"适宜",

"index_tr":"适宜",

"index_co":"舒",

"st1":"21","st2":"12","st3":"24","st4":"12","st5":"25","st6":"14", #不明

"index_cl":"较适宜",

"index_ls":"适宜",

"index_ag":"极易发"

}}

如何得到天气情况?在那个接口获取?

据我所知,气象局提供三个天气查询接口,如下:

1、实时天气接口

地址: sk/【城市代码】.html

例如:查询北京实时天气:

结果:

{"weatherinfo":{"city":"北京","cityid":"101010100","temp":"13","WD":"南风","WS":"2","SD":"59%","WSE":"2","time":"10:30","isRadar":"1","Radar":"JC_RADAR_AZ9010_JB"}}

2、今日天气接口

地址:【城市代码】.html

例如:查询北京今日天气:

结果:

{"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"15","temp2":"5℃","weather":"阵雨转阴","img1":"d3.gif","img2":"n2.gif","ptime":"08:00"}}

3、今日及未来天气接口【内容最详细】

地址:【城市代码】.html

例如:查询北京今日及未来天气:

结果:

{"weatherinfo":{"city":"北京","city_en":"beijing","date_y":"2013年10月22日","date":"",

"week":"星期二","fchh":"08","cityid":"101010100","temp1":"15℃~5℃","temp2":"15℃~4℃……

…【省略】"index_tr":"适宜","index_co":"较舒适",

"st1":"11","st2":"1","st3":"13","st4":"5","st5":"14","st6":"4","index_cl":"较不宜",

"index_ls":"不太适宜","index_ag":"不易发"}}

参考:

jquery.simpleweather.js怎么用

只需在网站添加并引用jquery.simpleWeather.js。然后初始化simpleWeather,设置WOEID,美国邮递区号或位置,添加一个div与``天气的ID(或任何想要的,只是改变它在init)。

!--html--

div id="weather"/div

/*---css---*/

body {

font: 13px 'Open Sans', "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;

background: #0091c2;

}

#weather {

width: 425px;

margin: 0px auto;

text-align: center;

text-transform: uppercase;

}

#weather h2 {

margin: 0 0 8px;

color: #fff;

font-size: 150px;

font-weight: 300;

text-align: center;

text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15);

}

#weather ul {

margin: 0;

padding: 0;

}

#weather li {

background: #fff;

background: rgba(255,255,255,0.90);

padding: 20px;

display: inline-block;

border-radius: 5px;

}

#weather .currently {

margin: 0 20px;

}

//----js

$(document).ready(function() {

$.simpleWeather({

zipcode: '',

woeid: '2357536',

location: '',

unit: 'f',

success: function(weather) {

html = 'h2'+weather.temp+'°'+weather.units.temp+'/h2';

html += 'ulli'+weather.city+', '+weather.region+'/li';

html += 'li class="96e5-63f5-59be-f1b1 currently"'+weather.currently+'/li';

html += 'li'+weather.tempAlt+'°C/li/ul';

$("#weather").html(html);

},

error: function(error) {

$("#weather").html('p'+error+'/p');

}

});

});

扫描二维码推送至手机访问。

版权声明:本文由黑客技术发布,如需转载请注明出处。

本文链接:https://w-123.com/213534.html

“jquery天气接口的简单介绍” 的相关文章

苹果尚未修补 macOS Big Sur 与 Catalina 的关键漏洞

尽管发布了一个更新来解决macOS Monterey中的两个零日漏洞,但苹果还没有将其应用于最后两个macOS版本,这可能会让多达40%正在使用的Mac计算机处于危险之中。 苹果在2022年3月31日对macOS Monterey的更新中解决了这些关键的漏洞。然而,到目前为止,它还没有更新macO...

安全研究人员通过苹果 AirTag 追踪伪装机构 最终指向德国联邦宪法保卫局

一位研究人员将苹果公司的一个AirTags发送到德国一个神秘的”联邦机构”,以确定其真正的办公室,并帮助证明它确实是一个情报机构的一部分。苹果公司的AirTags已经在涉及追踪个人的案件中被用得有声有色,但现在一位德国研究人员在揭露政府机密时使用了一个。 活动家Lilith Wittmann声称,...

全新 SideWalk 后门攻击针对美国电脑零售业务

一家位于美国的电脑零售公司成为SideWalk攻击的目标,这种攻击以前从未被发现,是一个中国高级黑客组织最近开展的活动一部分,该组织主要以专门针对东亚和东南亚实体的网络攻击而闻名。 斯洛伐克网络安全公司ESET在持续跟踪名为SparklingGoblin的高级威胁过程当中发现了这个攻击,被认为与Wi...

太平洋城市银行遭遇勒索软件 AvosLocker 攻击

上个月,美国主要韩裔美国人社区金融服务提供商之一的太平洋城市银行(Pacific City Bank,PCB)遇到了勒索软件攻击事件。 该银行向其客户发送信函,告知他们2021年8月30日发现的一个安全问题,并称这个问题已经解决。 2021年9月7日,PCB完成了对此事件的内部调查,发现勒索软件犯罪...

安全报告:黑客利用木马程序感染300多万台电脑 攫取1.2TB以上数据

Nord Locker 安全分析师发现,在 2018-2020 年间黑客利用一个木马化恶意程序,感染了超过 300 多万台电脑,并从中攫取了 1.2T 以上的敏感信息。这款尚未命名的恶意软件从超过 325 万台 Windows PC 中收集信息,收集的数据包括 20 亿个 cookies 和 110...

奥斯汀街头骗子盯上停车咪表:放置自制二维码以窃取付款信息

永远不要低估骗子的狡猾。不法分子从人们尤其是不太懂技术的人那里偷钱的方法多得令人眼花缭乱。最近在美国几个城市发现的一个做法是在停车咪表上贴上不属于设备本身的二维码,引导用户进入虚假网站,然后收集受害者的付款信息。 奥斯汀和圣安东尼奥的执法部门在假期期间发现了一些出现在停车表上的二维码贴纸,并发出了...

评论列表

晴枙卮留
2年前 (2023-01-28)

内 "index48":"较舒适","index48_d":"建议着薄外套或牛仔衫裤等服装。年老体弱者宜着夹克衫、薄毛衣等。昼夜温差较大,注意适当增减衣服。", #紫外 洗车 旅游 舒适指数 晨练 晾晒 过敏 "index_uv":"弱", "in

依疚纵性
2年前 (2023-01-28)

较舒适","index48_d":"建议着薄外套或牛仔衫裤等服装。年老体弱者宜着夹克衫、薄毛衣等。昼夜温差较大,注意适当增减衣服。", #紫外 洗车 旅游 舒适指数 晨练 晾晒 过敏 "index_uv":"

假欢鸢旧
2年前 (2023-01-28)

","04":"雷阵雨","05":"雷阵雨伴有冰雹","06":"雨夹雪","07":"小雨","08":"中雨","09":"大雨","10":"暴雨","11":

断渊山柰
2年前 (2023-01-28)

要是国家气象局和国外两个来源(指数据来源)。国外方面主要是雅虎(XML格式,谷歌已经停掉了自家的天气API);国内数据由国家气象局提供(JSON格式)。在知乎看到过一篇专业人士评论,雅虎可以提供全球范围的且非常精细的天气数据(小时级更新),但主要是通过计算机自动生成。而国家气象局则是各地经验

竹祭花桑
2年前 (2023-01-28)

URL: 该接口来源网络,应该是一个流传比较久的接口,大发现准确性和稳定性可能不稳定。接口分析如下:{"weatherinfo":{ #基本信息 "city":"北京","city_en":"beijing","date_y":"2013年9月24日","date":"","

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。