https://github.com/juliuste/wikipedia-location-search
UNMAINTAINED/DEPRECATED - Search for wikipedia articles based on given geolocation.
https://github.com/juliuste/wikipedia-location-search
library
Last synced: 11 months ago
JSON representation
UNMAINTAINED/DEPRECATED - Search for wikipedia articles based on given geolocation.
- Host: GitHub
- URL: https://github.com/juliuste/wikipedia-location-search
- Owner: juliuste
- License: isc
- Archived: true
- Created: 2017-12-15T21:55:11.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2021-10-24T06:58:31.000Z (over 4 years ago)
- Last Synced: 2024-12-02T15:48:12.031Z (over 1 year ago)
- Topics: library
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# :warning: UNMAINTAINED, PLEASE USE [WIKIDATA](https://www.wikidata.org) INSTEAD.
# wikipedia-location-search
Search for wikipedia articles based on given geolocation using [this API](https://en.wikipedia.org/w/api.php?action=query&list=geosearch&gscoord=37.786952%7C-122.399523&gsradius=10000&gslimit=10). Work in progress.
[](https://www.npmjs.com/package/wikipedia-location-search)
[](https://travis-ci.org/juliuste/wikipedia-location-search)
[](https://greenkeeper.io/)
[](https://david-dm.org/juliuste/wikipedia-location-search)
[](https://david-dm.org/juliuste/wikipedia-location-search#info=devDependencies)
[](LICENSE)
[](https://gitter.im/juliuste)
## Installation
```shell
npm install wikipedia-location-search
```
## Usage
The module returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) that will resolve in a list of locations:
```js
const articles = require('wikipedia-location-search')
articles(coordinates, opt)
```
The defaults for `opt` look like this:
```js
{
language: 'en', // wiki language code
maxDistance: 10000, // max. distance to the coordinates in meters
maxResults: 10 // max. number of results returned
}
```
```js
articles({latitude: 37.786952, longitude: -122.399523}, {language: 'de'})
.then(console.log)
```
would give you something like this:
```js
[
{
"id": 39927,
"title": "Wikimedia_Foundation",
"coordinates": {
"longitude": -122.39957,
"latitude": 37.78687
},
"distance": 10
},
{
"id": 1365097,
"title": "Cartoon_Art_Museum",
"coordinates": {
"longitude": -122.40098480194,
"latitude": 37.787328048611
},
"distance": 135.1
},
{
"id": 904290,
"title": "San_Francisco_Museum_of_Modern_Art",
"coordinates": {
"longitude": -122.40083333333,
"latitude": 37.785833333333
},
"distance": 169.5
}
// … 7 more
]
```
## Contributing
If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit [the issues page](https://github.com/juliuste/wikipedia-location-search/issues).