GithubHelp home page GithubHelp logo

qwd / dev-site Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 85.0 10.28 MB

和风天气开发平台网站的源代码 Source code for dev.qweather.com

Home Page: https://dev.qweather.com

License: MIT License

HTML 43.51% SCSS 56.39% Shell 0.03% Ruby 0.07%
developer jekyll weather weather-api weather-data

dev-site's People

Contributors

anchor-j avatar equationzhao avatar foxzool avatar guox avatar knightwood avatar lanqiaozzz avatar qwrda avatar rtakland avatar taadis avatar xlofhappy avatar zhou-fuyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dev-site's Issues

加密签名及WebAPI相关的内容描述不清

以查询每日天气功能的JavaScript代码为例,需要通过以下代码才可以正常请求:

const now = Math.floor(Date.now() / 1000)
let parameters = {
    username: PUBLIC_ID,
    location: LOCATION_ID,
    t: now
  }
const sign = getSignature(parameters, PRIVATE_KEY)
const url = `https://devapi.qweather.com/v7/weather/3d?location=${LOCATION_ID}&username=${PUBLIC_ID}&t=${now}&sign=${sign}`
// 请求url获取对应数据...

而文档上对该接口请求参数的说明为:

请求参数包括必选和可选参数,参数之间使用&进行分隔。

location (必选) 需要查询地区的LocationID或以英文逗号分隔的经度,纬度坐标(十进制,最多支持小数点后两位),LocationID可通过城市搜索服务获取。例如 location=101010100location=116.41,39.92

key (必选) 用户认证key,请参考如何获取你的KEY。支持数字签名方式进行认证。例如 key=123456789ABC

lang 多语言设置,更多语言可选值参考语言代码。当数据不匹配你设置的语言时,将返回英文或其本地语言结果。

unit 数据单位设置,可选值包括unit=m(公制单位,默认)和unit=i(英制单位)。更多选项和说明参考度量衡单位

以上说明非常容易让开发者认为请求接口时,只允许传入以上四个参数

而在加密签名认证文档中,给出的签名参数是:

publicid: 公共ID,每个KEY都对应一个公共ID,可在控制台查看

t: 时间戳,秒级

sign: 数字签名

实际上,在请求WebAPI时,需要传入其他的参数,同时publicid字段似乎也和给出的JavaScript示例代码中的username字段不统一。

在网上搜寻了各种资料,都没有找到对应的说明,最终是在 https://github.com/Ink-33/Weather-Sign/blob/master/index.php#L63 这里找到了对应的代码片段才得以完成开发。

希望贵团队可以完善相关文档,方便后续其他开发者的开发工作。

DNS pollution

Because jsdelivr is DNS polluted so I can't use the H5 weather plugin. I have submitted a work order but no response.
The console reports the following errors
screenshot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.