Wikia API Client written in node.js
$ npm install --save node-wikia
var Wikia = require ( 'node-wikia' ) ;
var tibia = new Wikia ( 'tibia' ) ;
/*
tibia
.getNavigation()
.then(function(data) {
// do foo
})
.fail(function(err) {
// do bar
});
*/
Get information about the latest user activity on the current wiki
Get simplified article contents
Get wiki navigation links (the main menu of given wiki)
Get recommendations for article from many sources
Get pages related to a given article ID
Get results for combined (wiki and cross-wiki) search
Find suggested phrases for chosen query
Get details about selected users
=====
* required
getLatestActivity(options)
Parameter
Data Type
limit
integer
namespaces
array string
allowDuplicates
boolean
{
"items" : [
{
"article" : " integer" ,
"user" : " integer" ,
"revisionId" : " integer" ,
"timestamp" : " integer"
}
],
"basepath" : " string"
}
getRecentlyChangedArticles(options)
Parameter
Data Type
limit
integer
namespaces
array string
allowDuplicates
boolean
{
"items" : [
{
"article" : " integer" ,
"user" : " integer" ,
"revisionId" : " integer" ,
"timestamp" : " integer"
}
],
"basepath" : " string"
}
getArticleAsSimpleJson(id)
Parameter
Data Type
id*
integer
{
"sections" : [
{
"title" : " string" ,
"level" : " integer" ,
"content" : [
{
"type" : " string" ,
"text" : " string" ,
"elements" : [
{
"text" : " string" ,
"elements" : [
" ListElement"
]
}
]
}
],
"images" : [
{
"src" : " string" ,
"caption" : " string"
}
]
}
]
}
getArticleDetails(options)
Parameter
Data Type
ids*
array integer
titles
array string
abstract
integer
width
integer
height
integer
{
"items" : [
{
"original_dimensions" : {
"width" : " integer" ,
"height" : " integer"
},
"url" : " string" ,
"ns" : " integer" ,
"abstract" : " string" ,
"thumbnail" : " string" ,
"revision" : {
"id" : " integer" ,
"user" : " string" ,
"user_id" : " integer" ,
"timestamp" : " integer"
},
"id" : " integer" ,
"title" : " string" ,
"type" : " string" ,
"comments" : " integer"
}
],
"basepath" : " string"
}
Parameter
Data Type
category
array string
namespaces
array string
limit
integer
offset
string
{
"items" : [
{
"id" : " integer" ,
"title" : " string" ,
"url" : " string" ,
"ns" : " integer"
}
],
"offset" : " string" ,
"basepath" : " string"
}
getArticlesListExpanded(options)
Parameter
Data Type
category
array string
namespaces
array string
limit
integer
offset
string
{
"items" : [
{
"original_dimensions" : {
"width" : " integer" ,
"height" : " integer"
},
"url" : " string" ,
"ns" : " integer" ,
"abstract" : " string" ,
"thumbnail" : " string" ,
"revision" : {
"id" : " integer" ,
"user" : " string" ,
"user_id" : " integer" ,
"timestamp" : " integer"
},
"id" : " integer" ,
"title" : " string" ,
"type" : " string" ,
"comments" : " integer"
}
],
"offset" : " string" ,
"basepath" : " string"
}
{
"items" : [
{
"url" : " string" ,
"ns" : " integer" ,
"id" : " integer" ,
"title" : " string" ,
"backlink_cnt" : " integer"
}
],
"basepath" : " string"
}
getArticlesMostLinkedExpanded()
{
"items" : [
{
"url" : " string" ,
"ns" : " integer" ,
"abstract" : " string" ,
"revision" : {
"id" : " integer" ,
"user" : " string" ,
"user_id" : " integer" ,
"timestamp" : " integer"
},
"id" : " integer" ,
"title" : " string" ,
"type" : " string" ,
"backlink_cnt" : " integer" ,
"comments" : " integer"
}
],
"basepath" : " string"
}
getArticlesNewest(options)
Parameter
Data Type
namespaces
array string
limit
integer
minArticleQuality
integer
{
"quality" : " integer" ,
"original_dimensions" : {
"width" : " integer" ,
"height" : " integer"
},
"url" : " string" ,
"ns" : " integer" ,
"abstract" : " string" ,
"creator" : {
"avatar" : " string" ,
"name" : " string"
},
"thumbnail" : " string" ,
"creation_date" : " string" ,
"id" : " integer" ,
"title" : " string"
}
getArticlesPopular(options)
Parameter
Data Type
limit
integer
baseArticleId
integer
{
"items" : [
{
"id" : " integer" ,
"title" : " string" ,
"url" : " string"
}
],
"basepath" : " string"
}
getArticlesPopularExpanded(options)
Parameter
Data Type
limit
integer
baseArticleId
integer
{
"items" : [
{
"original_dimensions" : {
"width" : " integer" ,
"height" : " integer"
},
"url" : " string" ,
"ns" : " integer" ,
"abstract" : " string" ,
"thumbnail" : " string" ,
"revision" : {
"id" : " integer" ,
"user" : " string" ,
"user_id" : " integer" ,
"timestamp" : " integer"
},
"id" : " integer" ,
"title" : " string" ,
"type" : " string" ,
"comments" : " integer"
}
],
"basepath" : " string"
}
getArticlesMostViewed(options)
Parameter
Data Type
namespaces
array string
category
array string
limit
integer
baseArticleId
integer
{
"items" : [
{
"id" : " integer" ,
"title" : " string" ,
"url" : " string" ,
"ns" : " integer"
}
],
"basepath" : " string"
}
getArticlesMostViewedExpanded(options)
Parameter
Data Type
namespaces
array string
category
array string
limit
integer
baseArticleId
integer
{
"items" : [
{
"original_dimensions" : {
"width" : " integer" ,
"height" : " integer"
},
"url" : " string" ,
"ns" : " integer" ,
"abstract" : " string" ,
"thumbnail" : " string" ,
"revision" : {
"id" : " integer" ,
"user" : " string" ,
"user_id" : " integer" ,
"timestamp" : " integer"
},
"id" : " integer" ,
"title" : " string" ,
"type" : " string" ,
"comments" : " integer"
}
],
"basepath" : " string"
}
getArticlesMostViewedByHub(options)
Parameter
Data Type
hub*
array string
lang
array string
namespaces
array string
{
"items" : [
{
"wiki" : {
"id" : " integer" ,
"name" : " string" ,
"language" : " string" ,
"domain" : " string"
},
"articles" : [
{
"id" : " integer" ,
"ns" : " integer"
}
]
}
]
}
{
"navigation" : {
"wikia" : [
{
"text" : " string" ,
"href" : " string" ,
"children" : [
{
"text" : " string" ,
"href" : " string"
}
]
}
],
"wiki" : [
" WikiaItem"
]
}
}
getRecommendations(options)
Parameter
Data Type
id*
integer
limit
integer
{
"items" : [
{
"source" : " string" ,
"url" : " string" ,
"description" : " string" ,
"media" : {
"duration" : " integer" ,
"originalWidth" : " integer" ,
"thumbUrl" : " string" ,
"videoKey" : " string" ,
"originalHeight" : " integer"
},
"title" : " string" ,
"type" : " string"
}
]
}
Parameter
Data Type
ids*
integer or array integer
limit
integer
{
"items" : [
{
"url" : " string" ,
"text" : " string" ,
"imgUrl" : " string" ,
"id" : " integer" ,
"title" : " string"
}
],
"basepath" : " string"
}
getSearchCrossWiki(options)
Parameter
Data Type
query*
string
hub
array string
lang
array string
rank
array string
limit
integer
batch
integer
height
integer
width
integer
snippet
integer
{
"items" : [
{
"headline" : " string" ,
"desc" : " string" ,
"stats" : {
"users" : " integer" ,
"articles" : " integer" ,
"pages" : " integer" ,
"admins" : " integer" ,
"activeUsers" : " integer" ,
"edits" : " integer" ,
"videos" : " integer" ,
"images" : " integer"
},
"original_dimensions" : {
"width" : " integer" ,
"height" : " integer"
},
"url" : " string" ,
"image" : " string" ,
"flags" : [
" string"
],
"wam_score" : " number" ,
"id" : " integer" ,
"topUsers" : [
" string"
],
"wordmark" : " string" ,
"title" : " string" ,
"lang" : " string"
}
]
}
Parameter
Data Type
query*
string
type
string
rank
array string
limit
integer
minArticleQuality
integer
batch
integer
namespaces
array integer
{
"batches" : " integer" ,
"items" : [
{
"quality" : " integer" ,
"url" : " string" ,
"ns" : " integer" ,
"id" : " integer" ,
"title" : " string"
}
],
"total" : " integer" ,
"currentBatch" : " integer" ,
"next" : " integer"
}
getSearchSuggestion(options)
Parameter
Data Type
query*
string
{
"items" : [
{
"title" : " string"
}
]
}
Parameter
Data Type
ids*
array integer
size
integer
{
"items" : [
{
"name" : " string" ,
"avatar" : " string" ,
"url" : " string" ,
"user_id" : " integer" ,
"numberofedits" : " integer" ,
"title" : " string"
}
],
"basepath" : " string"
}
The MIT License (MIT)
Copyright (c) 2015 Gabriel Pedro
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.