Skip to content

Latest commit

 

History

History
64 lines (59 loc) · 1.72 KB

README.md

File metadata and controls

64 lines (59 loc) · 1.72 KB

PBot

Extension and Command Line tools to make webpages in firefox browser interact with underlying platform and shell.

Using a simple JavaScript API, give WebPages power to be controlled by external scripts:

How to Use

Run :
$ ./PBotConfig
	PBot Configuration:
Enter Script Base Path
/home/administrator/PBotScripts

Then to add Script for a webpage: How to Write Scripts
$ bash AddScript.sh
Add Script
Enter Script Path: /tmp/T1.js
Enter WebSite: www.google.com
Installed Script

Then Run:
$ ./PBotManager
to run the server. Load webpages in firefox and the scripts for those pages will be loaded.

How to write scripts

All script needs to be Stored in

pBot.onLoad(function()
{
/*
JavaScript to Run on WebPages
For Example: alert("Welcome to PBot");
*/
});

Use

pBot.exec(executable_path:string,callback)
to execute shell commands.
executable_path: The command to execute. callback : A function that receives the object with the following keys:
  • output:the output of command
  • err_code: the error code of the command
  • Make use of pBot.onError() that receives a function with error details as parameter to catch the errors.

    Use : pBot.requireFile(javascript_file_path,callback) to import external data.

    pBot.on(event,callback) is triggered when PBotClient program is executed with the following arguments:

    $ ./PBotClient --help
    PBotClient:
    Usage: PBotClient RECEIVER EVENT_NAME JSON_DATA
    
    RECEIVER is the website for which script is executing EVENT_NAME and JSON_DATA are passed to callback of pBot.on() function