0.1.3 • Published 7 years ago

betazeta v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

betazeta API para Node.js Build Status Build status

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 defecto true
  • crossContent - boolean combinar articulos, por defecto true
  • endDate - string obtener artículos a partir de una fecha final
  • full - boolean
  • localization - string artículos de acuerdo a un país específico
  • mini - boolean obtener solo algunos datos de los artículos, por defecto true
  • order_by - string indicar un orden
  • page - number número de página
  • pageSize - number total de artículos
  • site - string nombre del sitio
  • startDate - 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 articulo
  • site - string nombre del sitio

Ejemplos

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 articulo
  • site - string nombre del sitio

.articlePrev(object)

Obtener el artículo anterior al especificado

Parámetros soportados

  • name - string identificador del articulo
  • site - string nombre del sitio

.search(object)

Buscar artículos

Parámetros soportados

  • q - string que buscar
  • site - 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

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago