Weather project: some info
Based on a “Juan Londoño’s” GitHub repo, that uses a Weather API to get the temperature and other variables giving a city:
https://github.com/jc721/WeatherApp
You can see his code, but you will have to do this project starting from empty files ;D
This is a free-style project, show the information as you want!
Weather project: some info
Now you know that you can access to a lot of public APIs to get information.
Check this website to see a list of public APIs you can work with: https://public-apis.xyz/
Some are free, and others have different plans in which you have to pay.
An example of weather API is www.weatherbit.io, this API has a plan for free and other plans for companies, like Google Maps: https://www.weatherbit.io/pricing
Weather project: some info
In case you have problems creating account, or one day you make more than 500 calls you can use this one:
2d84c821e1ab4563b168e4d981912515
This API has a free plan with restricted access (500 calls a day), you can Sign Up in the free plan to get a key to use the API, you will receive an email with the key you will need to get the data:
Weather project: some info
To get the information of the current weather, the APIs have a link with explanations for each endpoint, you will need to use this one:
Step 1: Show the current temperature of a city
4. Put the fetch inside a function with the name “get”
5. Fetch sometimes could not work, APIs could send you an error message
To know if fetch works or not, use a catch(error) as explained here:
Manage errors is very important in coding, if you don’t understand errors. Do a console.log() in the catch to understand the error getting the complete message
A difference between a good and a bad developers, is that the good ones always manage all the possible errors!
Step 2: make this project public with Github.io
https://carlossanchezheil1984.github.io/myfirstproject/
Step 3: Refactor the code to show n cities
const cities = [];
cities.push({
name: "Barcelona",
latitude: 41.41,
longitude: 2.19,
});
cities.push({
name: "Madrid",
latitude: 40.41,
longitude: -3.70,
});
Step 4: Add a map to show your cities locations
https://docs.mapbox.com/mapbox-gl-js/example/add-a-marker/
Step 5: Start your portfolio of projects
Now you know how to publish your projects with github.io, we can create an Index to link all of them, so you can have in the same page, access to all your projects
You can use this link to put it in the CV or to send it to recruiters.
Link the Weather project and other projects you would like to share, in the React module you could also publish your code following this instructions: LINK
To create the public portfolio in github.io:
In your Github account just create a new repo with the name: yourusername.github.io, and add a index.html file:
Check the result:
https://carlossanchezheil1984.github.io/
And the repo:
https://github.com/carlossanchezheil1984/carlossanchezheil1984.github.io
Example of a student:
https://kristiinacwalina.github.io/