0.1.3 • Published 7 years ago
betazeta v0.1.3
betazeta API para Node.js
Simple librería para casi todo el contenido de Betazeta (Belelú, Bólido, Fayerwayer, Niubie, Sabrosía, Wayerless, Betazeta, Ferplei, Saborizante, Veoverde).
Instalación
$ npm install --save betazeta
Uso
const betazeta = require('betazeta')
betazeta.articles({ site: 'fayerwayer' }).then(articles => {
console.log(articles)
})
API
.articles(object
)
Obtener un listado de artículos.
Parámetros soportados
content
-boolean
mostrar el contenido de los artículos, por defectotrue
crossContent
-boolean
combinar articulos, por defectotrue
endDate
-string
obtener artículos a partir de una fecha finalfull
-boolean
localization
-string
artículos de acuerdo a un país específicomini
-boolean
obtener solo algunos datos de los artículos, por defectotrue
order_by
-string
indicar un ordenpage
-number
número de páginapageSize
-number
total de artículossite
-string
nombre del sitiostartDate
-string
obtener artículos a partir de una fecha inicial
Ejemplos
const startDate = new Date()
startDate.setDate(startDate.getDate() - 7)
betazeta.articles({
crossContent: false,
order_by: 'social_weight',
startDate
}).then(res => {
console.log(res)
})
betazeta.articles({
localization: 'cl',
pageSize: 30,
site: 'veoverde'
}).then(res => {
console.log(res)
})
.article(object
)
Obtener un artículo a partir de su identificador.
Parámetros soportados
name
-string
identificador del articulosite
-string
nombre del sitio
Ejemplos
- Obtener el artículo La octava temporada de Game Of Thrones será extremadamente corta
betazeta.article({
name: 'la-ultima-temporada-de-game-of-thrones-sera-tremendamente-corta',
site: 'fayerwayer'
}).then(res => {
console.log(res)
})
.articleNext(object
)
Obtener el artículo siguiente al especificado
Parámetros soportados
name
-string
identificador del articulosite
-string
nombre del sitio
.articlePrev(object
)
Obtener el artículo anterior al especificado
Parámetros soportados
name
-string
identificador del articulosite
-string
nombre del sitio
.search(object
)
Buscar artículos
Parámetros soportados
q
-string
que buscarsite
-string
nombre del sitio donde se buscara
Ejemplos
- Buscar sobre Game of Thrones en Fayerwayer
betazeta.search({
q: 'game of thrones',
site: 'fayerwayer'
}).then(res => {
console.log(res)
})
.tag(object
)
Obtener datos de un tag
Parámetros soportados
name
-string
nombre del tag
Ejemplos
- Tag de Game of Thrones en Fayerwayer
betazeta.tag({ name: 'game-of-thrones' }).then(res => {
console.log(res)
})
Licencia
MIT