Wikipedia query tag
The tag is Wikipedia query tag. If you type <wikipedia-query search="whatever you want to search"></wikipedia-query>
, it will post a Wikipedia article with the world you typed. After add the dependency by npm i @lrnwebcomponents/wikipedia-query
, it will appear on the package.json.
GeoIP API
In locationFromIP.js
, it fetched this.locationEndpoint
(the API is not working). It suppose to provide longitude and latitude.
IP Fast API
Similarly, in UserIP.js
, the API is used to determine the city and country.
Together
After we successfully fetched the location endpoint and user IP, we then read the data with json()
and pull the information we need (longitude, latitude, city and state )
Display the code
I added a link that shows the map of my location and Wikipedia articles about my city and state.
GitHub
This is a link to my GitHub. The file is under src --> LocationFromIP.js (GeoIP API) & UserIP.js (IP Fast API). Please feel free to leave command on both my GitHub and this blog as I'm totally new to these concepts and can be wrong!
Top comments (0)