888sports-api
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,2 +0,2 @@ | ||
require('dotenv').config(); | ||
// require('dotenv').config(); | ||
const axios = require('axios'); | ||
@@ -33,3 +33,3 @@ const { wrapper } = require('axios-cookiejar-support'); | ||
//'sec-ch-ua-platform': '"Linux"', | ||
'cookie': process.env.COOKIE || parseCookie(Ck), | ||
'cookie': parseCookie(Ck), | ||
//newrelic: 'eyJ2IjpbMCwxXSwiZCI6eyJ0eSI6IkJyb3dzZXIiLCJhYyI6IjI1MDk2NzQiLCJhcCI6IjMwNzYyODM3IiwiaWQiOiIzYTg3ODBjMmU1MzY1Y2U3IiwidHIiOiI2MWI5MTJmOWNkYmU0MjI5IiwidGkiOjE2MzQ4NzA2MDkzMjd9fQ==', | ||
@@ -46,3 +46,3 @@ origin: 'https://www.888sport.com', | ||
const jar = new CookieJar(); | ||
const URL = process.env.BASE || 'https://spectate-web.888sport.com'; | ||
const URL = 'https://spectate-web.888sport.com'; | ||
//console.log(JSON.stringify(jar)) | ||
@@ -49,0 +49,0 @@ const api = wrapper(axios.create({ |
'use strict' | ||
const qs = require('qs'); | ||
const { api, jar } = require("./api/base.api"); | ||
const { api, jar, URL } = require("./api/base.api"); | ||
const { cookiesSet } = require('./controllers/cookies.controller'); | ||
@@ -94,2 +94,3 @@ | ||
return new Promise((resolve, reject) => { | ||
console.log(`${URL}/spectate/sportsbook-req/getFeaturedMatchesEventsAjax/${sport}`) | ||
api.post(`/spectate/sportsbook-req/getFeaturedMatchesEventsAjax/${sport}`, qs.stringify(query), { | ||
@@ -96,0 +97,0 @@ headers: { |
{ | ||
"name": "888sports-api", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "api para 888sports.com", | ||
@@ -32,3 +32,2 @@ "main": "index.js", | ||
"axios-fetch-request": "^1.0.0", | ||
"dotenv": "^10.0.0", | ||
"qs": "^6.10.1", | ||
@@ -35,0 +34,0 @@ "tough-cookie": "^4.0.0" |
14
test.js
@@ -5,8 +5,18 @@ | ||
//getting sport data. MMA | ||
//getting data from 888sports | ||
sport.webConfig().then(async (rest) => { | ||
console.log(rest.cookie) | ||
var sp = await sport.allSports(rest.cookie); | ||
console.log(sp) | ||
var boxing = await sport.getWidgetEvent('mma', 'Featured Homepage', rest.cookie) | ||
console.log(boxing) | ||
//var sp = await sport.allSports(rest.cookie); | ||
//console.log(sp) | ||
}) | ||
// sport.getFeaturedMatchesEvents('boxing', { | ||
// country: 'BRA' | ||
// }).then(rest => { | ||
// console.log(rest) | ||
// }) | ||
// sport.breadcrumbs().then(rest => { | ||
@@ -13,0 +23,0 @@ // console.log(rest) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
385398
5
319
0
- Removeddotenv@^10.0.0
- Removeddotenv@10.0.0(transitive)