https://github.com/mudroljub/angular-wiki-search
AngularJS module for consuming Wikipedia API.
https://github.com/mudroljub/angular-wiki-search
angularjs wikipedia wikipedia-api wikisearch
Last synced: 8 months ago
JSON representation
AngularJS module for consuming Wikipedia API.
- Host: GitHub
- URL: https://github.com/mudroljub/angular-wiki-search
- Owner: mudroljub
- License: mit
- Created: 2015-10-19T09:52:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-06-14T20:11:49.000Z (almost 7 years ago)
- Last Synced: 2024-11-17T04:51:22.206Z (over 1 year ago)
- Topics: angularjs, wikipedia, wikipedia-api, wikisearch
- Language: HTML
- Homepage: http://mudroljub.github.io/angular-wiki-search/
- Size: 1.62 MB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# [Angular Wiki Search](http://mudroljub.github.io/angular-wiki-search/)
AngularJS module for consuming Wikipedia API.
See it in action: [mudroljub.github.io/angular-wiki-search](http://mudroljub.github.io/angular-wiki-search/)
You can find an advanced version here: [github.com/mudroljub/power-wiki-search](https://github.com/mudroljub/power-wiki-search)
## Install
Just download the directory and open index.html file:
```sh
$ git clone https://github.com/mudroljub/angular-wiki-search.git
$ bower install
$ open index.html
```
If you don't use [Bower](http://bower.io/), you can manually resolve dependencies from bower.json file.
## Documentation
The main `WikiController` consists of two main public methods:
- `wiki.openArticle(title)`
- `wiki.searchWikipedia(term)`
Those methods getting data from [Wikipedia API](http://en.wikipedia.org/w/api.php) in JSONP format (see [API documentation](https://www.mediawiki.org/wiki/API:Main_page)).
Both methods have those common URL params:
```js
var params = {
action: 'query',
prop: 'extracts|pageimages', // get article's content and images
format: 'json',
formatversion: 2, // support utf-8
callback: 'JSON_CALLBACK'
}
```
Specific params for `openArticle` method are:
```js
{
titles: title, // title is a variable
redirects: '' // auto-redirecting to an article
}
```
Specific params for `searchWikipedia` method are:
```js
{
generator: 'search',
gsrsearch: term, // term is a variable
pilimit: 'max', // enable images for all results
exlimit: 'max', // enable content for all results
exintro: '' // get only article's intro
}
```
## To-do list
- error handling