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