0.1.3 • Published 9 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 betazetaUso
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-booleanmostrar el contenido de los artículos, por defectotruecrossContent-booleancombinar articulos, por defectotrueendDate-stringobtener artículos a partir de una fecha finalfull-booleanlocalization-stringartículos de acuerdo a un país específicomini-booleanobtener solo algunos datos de los artículos, por defectotrueorder_by-stringindicar un ordenpage-numbernúmero de páginapageSize-numbertotal de artículossite-stringnombre del sitiostartDate-stringobtener 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-stringidentificador del articulosite-stringnombre 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-stringidentificador del articulosite-stringnombre del sitio
.articlePrev(object)
Obtener el artículo anterior al especificado
Parámetros soportados
name-stringidentificador del articulosite-stringnombre del sitio
.search(object)
Buscar artículos
Parámetros soportados
q-stringque buscarsite-stringnombre 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-stringnombre del tag
Ejemplos
- Tag de Game of Thrones en Fayerwayer
betazeta.tag({ name: 'game-of-thrones' }).then(res => {
console.log(res)
})Licencia
MIT