idk get back later

master
Bronwen 2020-11-23 00:34:50 -05:00
parent ca1e7e4208
commit 99d75c871b
1 changed files with 11 additions and 3 deletions

View File

@ -38,7 +38,7 @@ module.exports = function (req, res) {
c3: "",
c4: ""
};
var script = $('#jscode').next().html();
// Finds our string of data on the page
@ -46,7 +46,7 @@ module.exports = function (req, res) {
var itemerIndex = script.search("itemer");
if (itemerIndex === -1) {
console.log(url + "didn't work.");
console.log(url + " didn't work.");
url = Math.floor(Math.random() * 100000).toString();
getColorJson('http://colorhunt.co/c/' + url);
return;
@ -80,4 +80,12 @@ module.exports = function (req, res) {
// Generates first color code and initializes recursive function.
var url = Math.floor(Math.random() * 100000).toString();
getColorJson('http://colorhunt.co/c/' + url);
};
};
function getRandom() {
return new Promise(res => {
request('http://colorhunt.co/c/random')
});
}