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

busy-hours

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

busy-hours - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

dist/index.js

@@ -1,1 +0,1 @@

'use strict';var _Promise='undefined'==typeof Promise?require('es6-promise').Promise:Promise,request=require('axios'),cheerio=require('cheerio'),moment=require('moment');function busy_hours(a,b){var c=require('@google/maps').createClient({key:b,Promise:_Promise}),d=function(a){return{hour:moment().hour(a[0]).format('HH'),percentage:a[1]}},e=function(a){if(a.data){var b=a.data,c=['APP_INITIALIZATION_STATE=','window.APP_FLAGS'],e=b.substring(b.lastIndexOf(c[0])+c[0].length,b.lastIndexOf(c[1])),f=eval(e),g=eval(f[3][6].replace(')]}\'','')),h=g[0][1][0][14][84];if(null===h)return{status:'error',message:'Place has no popular hours'};var i={status:'ok',week:Array.from(Array(7).keys()).map(function(a){return{day:moment().isoWeekday(a).format('ddd').toLowerCase(),hours:Array.from(h[0][a][1]).map(function(a){return d(a)})}})},j=h[7];return void 0!==j&&(i.now=d(j)),i}return{status:'error'}},f=function(a){var b=a.json.result.url;return b?request({url:b,headers:{"User-Agent":'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'}}):{status:'error',message:'Invalid url'}},g=function(a){return{status:'error',message:a}},h=c.place({placeid:a},g).asPromise().then(f).then(e);return new _Promise(function(a){a(h)}).catch(g)}module.exports=busy_hours;
'use strict';var _Promise='undefined'==typeof Promise?require('es6-promise').Promise:Promise,request=require('axios'),moment=require('moment');function busy_hours(a,b){var c=require('@google/maps').createClient({key:b,Promise:_Promise}),d=function(a){return{hour:moment().hour(a[0]).format('HH'),percentage:a[1]}},e=function(a){if(a.data){var b=a.data,c=['APP_INITIALIZATION_STATE=','window.APP_FLAGS'],e=b.substring(b.lastIndexOf(c[0])+c[0].length,b.lastIndexOf(c[1])),f=eval(e),g=eval(f[3][6].replace(')]}\'','')),h=g[0][1][0][14][84];if(null===h)return{status:'error',message:'Place has no popular hours'};var i={status:'ok',week:Array.from(Array(7).keys()).map(function(a){var b={day:moment().isoWeekday(a).format('ddd').toLowerCase(),hours:[]};return h[0][a]&&h[0][a][1]&&(b.hours=Array.from(h[0][a][1]).map(function(a){return d(a)})),b})},j=h[7];return void 0!==j&&(i.now=d(j)),i}return{status:'error'}},f=function(a){var b=a.json.result.url;return b?request({url:b,headers:{"User-Agent":'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36'}}):{status:'error',message:'Invalid url'}},g=function(a){return{status:'error',message:a}},h=c.place({placeid:a},g).asPromise().then(f).then(e);return h}module.exports=busy_hours;
{
"name": "busy-hours",
"version": "0.0.1",
"version": "0.0.2",
"description": "Hacky web scraper for retrieving Google Places popular times data",

@@ -23,3 +23,2 @@ "main": "./dist/index.js",

"axios": "^0.17.1",
"cheerio": "latest",
"moment": "^2.20.1"

@@ -26,0 +25,0 @@ },

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