@captainsafia/ratatouille
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -45,3 +45,5 @@ 'use strict'; | ||
get servings() { | ||
return this.$('.servings-count span:first-child').text(); | ||
const rawString = this.$('.adjustServings .subtext').text(); | ||
const numServings = rawString.match(/\d+/g); | ||
return numServings ? numServings[0] : 0; | ||
} | ||
@@ -48,0 +50,0 @@ |
{ | ||
"name": "@captainsafia/ratatouille", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A Node.js interface to Allrecipes.com", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,5 +17,3 @@ # ratatouille | ||
> import Ratatouille from '@captainsafia/ratatouille'; | ||
> const recipe = Ratatouille.load('http://allrecipes.com/recipe/254910/kicked-up-mac-cheese').then(function(html) { | ||
return new Ratatouille(html); | ||
}}); | ||
> const recipe = new Ratatouille('http://allrecipes.com/recipe/254910/kicked-up-mac-cheese'); | ||
> recipe.readyInTime | ||
@@ -22,0 +20,0 @@ '25 minutes' |
@@ -24,3 +24,5 @@ import cheerio from 'cheerio'; | ||
get servings() { | ||
return this.$('.servings-count span:first-child').text(); | ||
const rawString = this.$('.adjustServings .subtext').text(); | ||
const numServings = rawString.match(/\d+/g) | ||
return numServings ? numServings[0] : 0; | ||
} | ||
@@ -42,3 +44,3 @@ | ||
} | ||
get calories() { | ||
@@ -45,0 +47,0 @@ return this.$('.calorie-count span:first-child').text(); |
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
467
16772
55