npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

scriptbox

v0.0.3-patch5

Published

Script box is a full VAS application

Downloads

27

Readme


ScriptBox SMS gateway


Instalation

 npm install -g scriptbox

For contributors see detailed instructions here

How use

In first you need configure the scriptbox

scriptbox config

After config, run scriptBox scriptbox start

By default scriptBox listen the port 13014

Goto to http://127.0.0.1:13014 for the dashboard

Goto to http://127.0.0.1:13014/admin for administrate

Default user

the administrator : login: oshimin, password: secret

the active user : login: bob, password: secret

the unactive user : login: joe, password: secret

Explain SMS service philosophie

Each SMS service is a 'Mot Cle' (keyword in english)

Each Mot Cle must be link to a script

Each Mot Cle must be have a validtor expression(RegEx)

Each Mot Cle must be have a reject expression(RegEx)

A service can rewrite SMS, the RegEx used for rewrite is the validator expression.

Add a script

Click on "Main Menu" > "Script" > "Ajouter" Fill nom(name), description and script (javascript programme), set Module "off".

Sample script
//Nom: hello
//Description : Hello SMS
//Module : OFF
var message = new MSG(sms); // build a new sms
message.msgdata = "Hello SMS!"; // set message text 
message.sendSMS(); // send message to the sender

this script reply "Hello SMS" on each request.

Add a module

Click on "Main Menu" > "Script" > "Ajouter" Fill nom(name), description and script (javascript programme), set Module "on".

Sample module
//Nom: numeros
//Description : Hello SMS
//Module : ON
/*Your script Here*/
exports.airtel = /^((\+|00)?241)?0(4|7)\d{6}$/;
exports.libertis = /^((\+|00)?241)?0(2|6)\d{6}$/;
exports.moov = /^((\+|00)?241)?05\d{6}$/;
exports.azur = /^((\+|00)?241)?03\d{6}$/;
exports.GT = /^((\+|00)?241)?(01)?\d{6}$/;

this module can be used in script numeros = require('numeros');

Sample script who use module
//Nom: hello2
//Description : Hello SMS and get information network
//Module : OFF
var num = require("numeros");
logger.log(sms.sender); // logger is like `console` in nodejs 
// sms contain the SMS object 
var m = new MSG(sms);
	m.msgdata = "Hello SMS!";
	if(num.airtel.test(sms.sender))
		m.msgdata += " - Airtel";
	else if(num.libertis.test(sms.sender))
		m.msgdata += " - Libertis";
	else if(num.azur.test(sms.sender))
		m.msgdata += " - Azur";
	else if(num.moov.test(sms.sender))
		m.msgdata += " - MOOV";
	else if(num.GT.test(sms.sender))
		m.msgdata += " - GT";
	else 
		m.msgdata += " - Je sais pas d'ou vient ce numero";
	
	m.sendSMS();

You can juste create a Mot Cle (keyword) , and send sms for test it;

    Nom : test
    Script : hello2
    Validateur SMS : Oui
    Reject Sender : Non

Add an expression

Click on "Main Menu" > "Expression" > "Ajouter" Fill nom(name), Validateur(RegExp), Choose Option

Sample expression
    Nom : Oui
    Validateur (?:) => /(?:)/ => allways true
    
    Nom : Non
    Validateur ^[^\w\W]$ => /^[^\w\W]$/ => allways false

    Nom : Gaboneese number
    Validateur ^((00|\+)?241) => /^((00|\+)?241)/ => allways start by 241,+241 or 00241

Add a connector

Click on "Main Menu" > "Connecteor" > "Ajouter" Fill Identifiant(name), Choose Type

Sample connector
    Nom : KANNEL
    Type : KANNEL
Sample Connfig connector
    host : 127.0.0.1
    Port : 13013
    id : LoveIsMyReligion
    tls : false
Start a connector

Click on "Main Menu" > "Connecteor" > "List" > Start Server

Stop a connector

Click on "Main Menu" > "Connecteor" > "List" > Stop Server

Add an Mot cle(keyword)

Click on "Main Menu" > "Mot cle" > "Ajouter"

Fill nom(name), choose Script, Validateur SMS(Check SMS format),Reject Sender(check sender), "Numeros Courts(short Code allowed, no select for all short Codes)

Sample Mot Cle
    Nom : hello
    Script : hello
    Validateur SMS : Oui
    Reject Sender : Non

Test Script

Configue and start the connector (SMPP or kannel) and send "hello" to the connector, scriptbox willl reply "Hello SMS"

TODO

  • More documentation
  • More samples (Ex. voting system)
  • Routing system
  • Script installer for production instance

Screen Capture

Capture 9

Capture 2

Capture 1

Capture 3

Capture 4

Capture 5

Capture 6

Capture 7

Capture 8

LICENCE

(The MIT License)

Copyright (c) 2007-2009 Ulrich Badinga <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.