fqterm.import("utils.js"); //NOTE: 1. this file should be in utf8 // 2. if you cannot enter "BMS", this script may fail. //first enter the folder, then start script. var timeout = 6000; var path = "c:\\elite-sex\\"; //DO NOT miss last slash var base_path = path; newlinere = /\r\n|\n|\r/mg; //var path = /home/dp2/elite/ var lastline = function() { return fqterm.getText(fqterm.rows() - 1); } var firstline = function() { return fqterm.getText(0); } var currentline = function(){ return fqterm.getText(fqterm.caretY()); } var download = function(filename) { var last_line = lastline(); fqterm.sendString("r"); var n = 10; while(n--) { sleep(timeout / 10); if (lastline() != last_line) break; } var article = fqterm.copyArticle(); last_line = lastline(); fqterm.sendString("q"); n = 10; while(n--) { sleep(timeout / 10); var c = lastline(); if (c != last_line) { break; } } return article; } var make_html_header = function(num) { num = parseInt(num); var result = '
\n'+ '\n'+ '\n'+ 'FQTerm Article Downloader
FQTerm --- BBS client based on Qt library
\n'+ '
\n'+ 'http://code.google.com/p/fqterm
\n'+ '\n'+ '\n'; return result; } var make_index_header = function() { var result = '
\n' + '\n' + '\n' + 'FQTerm Article Downloader
\n' + 'Up\n' + '
\n' + '\n' + 'Up\n' + '
\n' + 'FQTerm --- BBS client based on Qt library
\n' + '
\n' + 'http://code.google.com/p/fqterm
\n' + '\n' + '