penaplast3104-sms-bomber
Version:
Simple sms bomber
64 lines (49 loc) • 2.06 kB
Markdown
A simple SMS bomber package for automated testing of SMS service by bombarding with messages. Initially, the configuration has sites for Russian phone numbers. You can change this in the configuration. **Use responsibly and only for legitimate purposes, with consent.**
```bash
yarn add penaplast3104-sms-bomber
```
```javascript
const { startBombing } = require('penaplast3104-sms-bomber');
startBombing({
phoneNumber: '99999999999',
times: 1,
options?: [...flags],
sites?: [...sites],
onBobmingStart?: ({ phoneNumber, times}) => void,
onBobmingFinish?: ({ phoneNumber, times}) => void,
});
```
You can add an array of your sites to the sites using the example from the configuration item.
```bash
node start.js <phoneNumber> <times> <...--flags>
```
Replace <phoneNumber> with the target phone number and <times> with the number of attempts.
```javascript
--debug // includes logs and launch a "headful" version of Chrome
--without-default-sites // do not use sites installed in the package. ONLY FOR use as an NPM package. For command line edit config in ./constants/sites.js
```
You can configure additional sites by editing the ./constants/sites.js file.
```typescript
const object = {
url: string, // site url, It is advisable to search for unpopular sites, without robot detectors
options?: {
withoutFirstNumber?: boolean, // for inputs where the region code is initially set
},
queue: Array<{
selector: string, // html element selector
action: 'click/type', // page action
isNumber?: boolean, // if this parameter is true, the input is entered target phone nubmer, type action
value?: string, // value for nonIsNumber inputs, type action
delay?: number, // delay before action
isOptional?: boolean, // for optional steps, if the selector is not found, the step will be skipped without error
}>
}
```