triangle-utils 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "main": "index.js",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -3,6 +3,7 @@ import { ScrapingBeeClient } from "scrapingbee"
3
3
  export default class Utils_Bee {
4
4
 
5
5
  constructor(config) {
6
+ this.config = config
6
7
  this.bee = new ScrapingBeeClient(config.scraping_bee_api_key)
7
8
  this.text_decoder = new TextDecoder()
8
9
  }
@@ -10,7 +11,7 @@ export default class Utils_Bee {
10
11
  async get(url, params) {
11
12
  for (let i = 0; i < 3; i++) {
12
13
  try {
13
- const response = await bee.get({
14
+ const response = await this.bee.get({
14
15
  url : url,
15
16
  params : params
16
17
  }).catch(response => response)
@@ -32,7 +33,7 @@ export default class Utils_Bee {
32
33
  async google_search(query, news = false) {
33
34
  for (let i = 0; i < 3; i++) {
34
35
  try {
35
- const bee_url = "https://app.scrapingbee.com/api/v1/store/google?api_key=" + config.scraping_bee_api_key + "&search=" + encodeURI(query) + (news ? "&search_type=news" : "")
36
+ const bee_url = "https://app.scrapingbee.com/api/v1/store/google?api_key=" + this.config.scraping_bee_api_key + "&search=" + encodeURI(query) + (news ? "&search_type=news" : "")
36
37
  console.log(bee_url)
37
38
  const response = await fetch(bee_url)
38
39
  if (!response.ok) {