Switch to edit mode.
Name(s): add_meta1: "Inputs a web page, and outputs one that will reload itself in x seconds."
2: {text, x} = args
3: text = {@text}
4: head = 0
5: for line in [1..length(text)]
6: if (index(text[line], "<TITLE"))
7: text[line] = strsub(text[line], "<TITLE", tostr("<META http-equiv=\"refresh\" content=\"", x, "\"><TITLE"))
8: return text
9: elseif (index(text[line], "</HEAD"))
10: "No TITLE? That's ok, at least there is a HEAD."
11: text[line] = strsub(text[line], "</HEAD", tostr("<META http-equiv=\"refresh\" content=\"", x, "\"></HEAD"))
12: return text
13: endif
14: endfor
15: "This is bad, the HTML doesn't have a TITLE or HEAD. I don't think this is HTML..."
16: return text
17: "Last modified by Dax (#789) on Wed Jul 22 20:32:42 1998 EDT."