Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vf-oscars-to-csv

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vf-oscars-to-csv - npm Package Compare versions

Comparing version 2023.1.0 to 2023.1.1

27

dist/index.js

@@ -8,2 +8,3 @@ "use strict";

const chrome_aws_lambda_1 = __importDefault(require("chrome-aws-lambda"));
const puppeteer_core_1 = __importDefault(require("puppeteer-core"));
exports.CATEGORY_LIST = [

@@ -41,2 +42,20 @@ 'BEST PICTURE',

exports.ballotToCsvRow = ballotToCsvRow;
async function getBrowser() {
// https://github.com/orgs/vercel/discussions/124#discussioncomment-569978
const options = process.env.AWS_REGION
? {
args: chrome_aws_lambda_1.default.args,
executablePath: await chrome_aws_lambda_1.default.executablePath,
headless: chrome_aws_lambda_1.default.headless
}
: {
args: [],
executablePath: process.platform === 'win32'
? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
: process.platform === 'linux'
? '/usr/bin/google-chrome'
: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
};
return await puppeteer_core_1.default.launch(options);
}
function verifyTitle(title) {

@@ -50,9 +69,3 @@ if (!exports.CATEGORY_LIST.includes(title)) {

console.log('connecting...');
const browser = await chrome_aws_lambda_1.default.puppeteer.launch({
args: chrome_aws_lambda_1.default.args,
defaultViewport: chrome_aws_lambda_1.default.defaultViewport,
executablePath: await chrome_aws_lambda_1.default.executablePath,
headless: chrome_aws_lambda_1.default.headless,
ignoreHTTPSErrors: true,
});
const browser = await getBrowser();
try {

@@ -59,0 +72,0 @@ const page = await browser.newPage();

{
"name": "vf-oscars-to-csv",
"version": "2023.1.0",
"version": "2023.1.1",
"description": "utility to extract Oscar ballots from Vanity Fair's Interactive Ballot",

@@ -5,0 +5,0 @@ "bin": {

@@ -1,2 +0,3 @@

import chromium from 'chrome-aws-lambda';
import chrome from 'chrome-aws-lambda';
import puppeteer, { Browser } from 'puppeteer-core';

@@ -39,2 +40,22 @@ export const CATEGORY_LIST = [

async function getBrowser(): Promise<Browser> {
// https://github.com/orgs/vercel/discussions/124#discussioncomment-569978
const options = process.env.AWS_REGION
? {
args: chrome.args,
executablePath: await chrome.executablePath,
headless: chrome.headless
}
: {
args: [],
executablePath:
process.platform === 'win32'
? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
: process.platform === 'linux'
? '/usr/bin/google-chrome'
: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
};
return await puppeteer.launch(options);
}
function verifyTitle(title: string): title is typeof CATEGORY_LIST[number] {

@@ -49,9 +70,3 @@ if (!CATEGORY_LIST.includes(title as typeof CATEGORY_LIST[number])) {

console.log('connecting...');
const browser = await chromium.puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
const browser = await getBrowser();

@@ -58,0 +73,0 @@ try {

Sorry, the diff of this file is not supported yet

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