Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Written by Penguin-Pal (https://pastebin.com/pEhBsWB3) and modified by Hey.youcp on June 10, 2017
- function pad(n, len) {
- n = String(n);
- if (n.length < len) {
- n = new Array(len - n.length + 1).join("0") + n;
- }
- return n;
- }
- function datify(timestamp, isEstimation) {
- var d = new Date(timestamp),
- c = isEstimation ? "~" : ":";
- return "[" + d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1, 2) + "-" + pad(d.getUTCDate(), 2) + " " + pad(d.getUTCHours(), 2) + c + pad(d.getUTCMinutes(), 2) + c + pad(d.getUTCSeconds(), 2) + "]";
- }
- var logs = "";
- var count = 0;
- var logModels = mainRoom.viewDiscussion.model.chats.models;
- logModels.map(function(a) {
- var b = a.attributes,
- d,
- isMsg = b.name.length > 0;
- if (!isMsg) {
- // (dolanside)
- } else {
- d = datify(b.timeStamp);
- new Date(b.timeStamp);
- logs += (
- (d + " ") +
- (isMsg ? "<" + b.name + "> " : "-!- ") +
- b.text + "\n"
- );
- count++;
- }
- });
- copy(logs);
- alert(count + " logs were copied to the clipboard!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement