Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
austinhuang0131 authored Dec 15, 2019
1 parent 0cffff2 commit a65c485
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1878,8 +1878,7 @@ bot.dialog('/9gag1',[
}
else if (results.response.entity.endsWith("Hot")) {
request("https://9gag.com/"+nsfw.find(i => {return i.user === session.message.address.user.id;}).gag+"/hot", function(err, response, body) {
console.log(body.split("<script type=\"text/javascript\">window._config = JSON.parse(\"")[1].split("\");</script>\n<script type=\"text/javascript\" src=\"")[0].replace(/\\/gi, ""))
var res = JSON.parse(body.split("<script type=\"text/javascript\">window._config = JSON.parse(\"")[1].split("\");</script>\n<script type=\"text/javascript\" src=\"")[0].replace(/\\/gi, "")).data;
var res = JSON.parse(body.split("JSON.parse(\"")[1].split("\");")[0].replace(/\\/g, "")).data;
if (err || !res) {
session.send("An error occured. Retry?");
session.replaceDialog("/fun");
Expand Down

0 comments on commit a65c485

Please sign in to comment.