Last active
December 15, 2015 10:39
-
-
Save jshawl/5247126 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var doScrape = function () { | |
var productTemplate = "{{#.}}" | |
+ "<form method='post' action='SOME_URL' class='riu-form'>" | |
+ "<a class='riu-logo' href='http://rackituponline.com'>Rack It Up</a>" | |
+ "<img src='{{OrigImageURL}}' class='riu-img'>" | |
+ "<h1>{{Name}}</h1>" | |
+ "<label>Price:</label>" | |
+ "<input type='text' value='{{OrigPrice}}' readonly>" | |
+ "<label>Color:</label>" | |
// + "<p>Colors: {{#Colors}}{{.}}, {{/Colors}}</p>" | |
+ "<select>" | |
+ "<option>color 1</option>" // need to loop through each of {{#Colors}} and input value between <option> | |
+ "</select>" | |
+ "<label>Size:</label> | |
// + "<p>Sizes: {{#Sizes}}{{.}}, {{/Sizes}}</p>" | |
+ "<select>" | |
+ "<option>size 1</option>" // need to loop through each of {{#Sizes}} and input value between <option> | |
+ "</select>" | |
+ "<label>Category</label>" | |
+ "<select>" | |
+ "<option></option>" // some type of loop here, too. | |
+ "</select>" | |
+ "<label>Notify me when: </label>" | |
+ "<select>" | |
+ "<option>The price drops by $ amount</option>" | |
+ "<option>The price drops by % amount</option>" | |
+ "<option>The item goes on sale</option>" | |
+ "</select>" | |
+ "<label>Send me an alert when the price drops by $</label>" //we'll need to update that dollar sign dynamically at some point | |
+ "<input type='text'>" | |
+ "<button type='submit'>Rack It!</button>" | |
+ "</form>" | |
+ "{{/.}}", | |
products = riuScraper.getProducts(); | |
$.modal(/*JSON.stringify(products) + */Mustache.render(productTemplate, products)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment