New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

opensea-scraper

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opensea-scraper - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "opensea-scraper",
"version": "1.0.1",
"version": "1.0.2",
"description": "Scraping accurate floor prices from opensea, because the API returns inacurate floor prices.",

@@ -5,0 +5,0 @@ "main": "src/OpenseaScraper.js",

@@ -26,4 +26,11 @@ const axios = require("axios");

const cardsArray = Array.prototype.slice.call(cardsNodeList); // you cannot use .map on a nodeList, we need to transform it to an array
const priceStr = cardsArray[0].querySelector(".Price--amount").textContent;
return Number(priceStr.split(",").join("."));
const floorPrices = cardsArray.map(card => {
try {
const priceStr = card.querySelector(".Price--amount").textContent;
return Number(priceStr.split(",").join("."));
} catch(err) {
return undefined;
}
}).filter(val => val); // filter out invalid (undefined) values
return Math.min(...floorPrices); // sometimes the order of elements is not accurate on Opensea, thats why we need to get the lowest value
});

@@ -30,0 +37,0 @@ await browser.close();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc