Editing User:452
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 81: | Line 81: | ||
prompt_captions :[], | prompt_captions :[], | ||
− | |||
feed_ids :[], | feed_ids :[], | ||
feed_images :[], | feed_images :[], | ||
Line 97: | Line 96: | ||
prompt_captions :"Captions in prompts", | prompt_captions :"Captions in prompts", | ||
− | |||
feed_ids :"Permalinks in the feed", | feed_ids :"Permalinks in the feed", | ||
feed_images :"Images in the feed", | feed_images :"Images in the feed", | ||
Line 207: | Line 205: | ||
switch (which) { | switch (which) { | ||
case "feed_ids": | case "feed_ids": | ||
− | if ($("#magic textarea").val().indexOf("\n|-") > -1) { | + | if ($("#magic textarea").val().indexOf("\n#") > -1 && $("#magic textarea").val().indexOf("\n|-") > -1) { |
− | $("#desc").html(" | + | $("#desc").html("This script can handle a table <b>or</b> a list, not both."); |
break; | break; | ||
} | } | ||
Line 220: | Line 218: | ||
$("#desc").html("loaded "+temparray.length+" feed_ids (urls)"); | $("#desc").html("loaded "+temparray.length+" feed_ids (urls)"); | ||
− | } | + | } else if (("\n"+$("#magic textarea").val()).indexOf("\n|-") > -1) { |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$("#desc").html("Loading table of feed_ids"); | $("#desc").html("Loading table of feed_ids"); | ||
temparray = ("\n"+$("#magic textarea").val().trim()).split("\n|-"); | temparray = ("\n"+$("#magic textarea").val().trim()).split("\n|-"); | ||
Line 290: | Line 279: | ||
break; | break; | ||
case "feed_ids": | case "feed_ids": | ||
− | temp = { ids:"", countall:0 } | + | temp = { array: [], list: "", ids:"", img: [], text: [], countunique:0, countall:0 } |
for(j in xkcd.feed_ids) { | for(j in xkcd.feed_ids) { | ||
temp.countall++; | temp.countall++; | ||
temp.ids += "\n#http://xkcd.com/1506/#post/"+j; | temp.ids += "\n#http://xkcd.com/1506/#post/"+j; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
if (xkcd.feed_ids[j].text && xkcd.feed_ids[j].img) { //can be null when duplicate | if (xkcd.feed_ids[j].text && xkcd.feed_ids[j].img) { //can be null when duplicate | ||
if (temp.text[xkcd.feed_ids[j].text] == undefined || temp.img[xkcd.feed_ids[j].img] == undefined) { | if (temp.text[xkcd.feed_ids[j].text] == undefined || temp.img[xkcd.feed_ids[j].img] == undefined) { | ||
Line 326: | Line 306: | ||
} | } | ||
$("#desc").append(" (unique: "+temp.countunique+") (all: "+temp.countall+")"); | $("#desc").append(" (unique: "+temp.countunique+") (all: "+temp.countall+")"); | ||
− | $("#magic textarea").val(temp.list+"\n|}\n"); | + | $("#magic textarea").val(temp.list+"\n|}\n"+temp.ids); |
delete temp; | delete temp; | ||
break; | break; |