Natsuha is a weather app that created with Taro and Yahoo Weather API for WeChat Mini Program. Now the stable version(v3.0.0) is released, welcome to experience and star.
- Pull down to refresh
- Swtich temperature between Fahrenheit and Celsius
- Display the weather condition by hour
- Display the weather condition by day
- Display the wind direction and speed
- Display the sun and moon
- Display the precipitation forecast
- Search weather information by city name
Firstly you should install the @tarojs/cli
globally.
Install dependencies.
Runs the app in the development mode. Open the developer tools of WeChat to view it. The app will be deployed if you make edits. You will also see any lint errors in the console.
Builds the app for production to the dist
folder. It correctly bundles the app in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes. The app is ready to be deployed!
The following files are not uploaded to GitHub because of private key, you must create them manually.
You need apply a key in Yahoo Weather API at first.
Then create a file index.js
in functions/getWoeid
, and insert the following codes with your keys.
/* eslint-disable */
const cloud = require('wx-server-sdk');
const OAuth = require('oauth');
cloud.init();
const header = {
'Yahoo-App-Id': YOUR_APP_ID,
};
const request = new OAuth.OAuth(
null,
null,
YOUR_CLIENT_ID,
YOUR_CLIENT_SECRET,
'1.0',
null,
'HMAC-SHA1',
null,
header,
);
exports.main = async (event, context) =>
new Promise((resolve, reject) => {
const lat = event.lat;
const lon = event.lon;
const lang = event.lang;
request.get(
`https://weather-ydn-yql.media.yahoo.com/forecastrss?lang=${lang}&format=json&lat=${lat}&lon=${lon}`,
null,
null,
(err, data, result) => {
resolve(data);
},
);
});
- Support multiple languages
- Optimize performance
- Optimize image loading
- Support Test
- Move the search component to a new page
- Drag and Drop
- Display multi city by swipe
Update elements of Yahoo Wether API. (2020-08-30)
Upgrage Taro to v2.0.6 and code optimization. (2020-03-14)
Upgrage Taro to v1.3.12 and fix bugs. (2019-08-10)
Fix bug of Wind Component. (2019-04-18)
Add Serach Component. (2019-03-11)
Optimization code. (2019-03-07)
Publish the first version. (2019-03-01)
Natsuha Weather is MIT licensed.