Developer reference

Module File Structure

Module File Structure

  • module/ - Name of a new module
  • columns.txt - Names and description of columns (HTML code can be used)
  • actions/ - Directory with action files: action 1.txt ... action N.txt
  • values/ - Directory with files of possible column values: values 1.txt ... values N.txt

To add a new module, create a new directory (with the above structure) in the modules/ directory. The essential files and directories are those that are marked red in the diagram; the other files are used to extend the functionality of the module.

Writing the Code

The action code can be written in any text editor, for example in Notepad ++

If your text editor has a syntax highlighter, it is best to choose JavaScript syntax highlighter. The action files have to be saved in UTF-8 without BOM.





List of the software methods

T.log("Начало работы");
resp = T.makeRequest("GET", T.get("url"));
body = T.encode(resp.body, resp.charset);
T.log("Конец работы");

Список методов:




T.sleep(long milliseconds)

T.enable(String flagName)
T.disable(String flagName)

byte[] T.decode(String string)
byte[] T.decode(String string, String charset)
String T.encode(byte[] bytes)
String T.encode(byte[] bytes, String charset)

String T.getId()

int T.getRowIndex()

Object T.getGlobal(...)
Object T.getGlobalObject(String key)
T.setGlobalObject(String key, Object object)

String T.get(...)
String T.getRowValue(String key)
T.setRowValue(String key, String value)

T.makeError(String error)

T.addLog(Object log)

T.addRow(String[] values)

String T.getProxy()
String T.getNextProxy()
T.setProxy(String proxyString)

T.deleteCookiesByUrl(String url)
T.deleteCookieByUrlAndName(String url, String name)

String T.getCookie(...)
String T.getCookieValue(String url, String name)
T.setCookie(String url, String name, String value)

Object[] T.getSession()
T.setSession(Object[] session)

byte[] T.readFromFile(String fileName)
T.writeToFile(String fileName, byte[] fileBytes)
T.writeToFile(String fileName, byte[] fileBytes, String fileMode)

T.createDir(String fileName)
boolean T.deleteDir(String fileName)
boolean T.deleteFile(String fileName)

Object T.getRandom(...)
Object T.getRandomValue(Object[] values)

String T.getRegExp(...)
String T.getRegExpValue(String source, String re)
String T.getRegExpValue(String source, String re, String format)

String T.getCaptcha(...)
String T.getCaptchaValue(byte[] captcha)
String T.getCaptchaValue(byte[] captcha, String[] params)

String T.makeURL(String urlBase, String[][] params)

String T.getHeaderReferer()
T.setHeaderReferer(String header)

String T.getHeaderUseragent()
T.setHeaderUseragent(String header)

Map<String, Object> T.makeRequest(String method, String url)
Map<String, Object> T.makeRequest(String method, String url, String[][] headers)
Map<String, Object> T.makeRequest(String method, String url, String[][] headers, String[][] body)
Map<String, Object> T.makeRequest(String method, String url, String[][] headers, String[][] body, String cahrset)