Giter Club home page Giter Club logo

weatherapi's Introduction

weatherAPI

前一阵写应用玩,想找个天气的接口直接调用,找了半天还是感觉“**天气网”的数据全点:

正打算用时发现它的接口不是 jsonp 的,JS 无法直接调用,唉...无奈啊不会后端。

继续找啊找,发现这篇帖子“宋体代码介绍一个JSONP 跨域访问代理API”,Yahoo 的 YQL 可以做跨域代理,我真是 out 了。立即用之,开始很爽,后来发现它的服务器在国外,加载太慢了......

搞个天气预报怎么这么悲催,我看别人挺 easy 的呀!

无耐继续找啊找......换个策略,看看有没有 php 写的 jsonp 接口,我找个服务器托管;啊哈,发现了这位哥的代码:https://github.com/lyonna/php-weather-info-cn,可是还不是 jsonp 的,唉...想省力好难啊,请教请教朋友,自己改个 jsonp 接口吧。

以下是我改完的 jsonp 接口(接口托管在 BAE 上):

/*
* cid: 城市代码
* callback: 回调函数
*/

再次感谢这位兄台:lyonna

weatherapi's People

Contributors

jinlong avatar

Watchers

 avatar  avatar

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.