Last active
January 2, 2016 02:29
-
-
Save danilovazb/8237833 to your computer and use it in GitHub Desktop.
Envio de SMS em massa com Gammu, utilizando lista de envio com nome.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/perl | |
############################################################ | |
# Script for sending messages with Gammu | |
# - Sending mass messages to your contacts list | |
# - Repeated sending messages | |
# | |
############################################################ | |
# Initially developed by: Gustavo | |
# Project continued by: DaniloVaz | |
# | |
# | |
############################################################ | |
system("clear"); | |
if ($^O =~ /MSWin32/) { | |
system("cls");}else {system("clear"); | |
} | |
$p2 = "sendSMSPAM.pl [-s | --single] <number> <amount>\n\n\tsendSMSPAM.pl [-m | --mass] <list_number.txt> <names.txt> <amount>\n"; | |
$p1 = "\t \033[1;5;33mSSSSS MM MM SSSSS\033[0m SSSSS PPPPPP AAA MM MM | |
\t\033[1;5;33mSS MMM MMM SS \033[0m SS PP PP AAAAA MMM MMM | |
\t\033[1;5;33m SSSSS MM MM MM SSSSS \033[0m SSSSS PPPPPP AA AA MM MM MM | |
\t\033[1;5;33m SS MM MM SS \033[0m SS PP AAAAAAA MM MM | |
\t\033[1;5;33m SSSSS MM MM SSSSS \033[0m SSSSS PP AA AA MM MM | |
by \033[1;32maceeeeeeeer\033[0m | |
--------------------------------------------------------------- | |
\033[1;34m28-12-13\033[0m \033[1;35m~~>\033[0m Project continued by: \033[1;36mDaniloVaz\033[0m ;) | |
~~> Método de envio por Gammu :)"; | |
if(@ARGV != 4){ | |
print "\n$p1\n\n\t$p2\n"; | |
exit; | |
} | |
if($ARGV[0] =~ '-s' | '--single'){ | |
print "\n$p1\n\n"; | |
if(!$msg){ | |
print " MSG: "; $msg = <STDIN>; | |
} | |
$nmr = $ARGV[1]; | |
$qnt = $ARGV[2]; | |
for (1..$qnt){ | |
system("echo '$msg' | gammu --sendsms TEXT $nmr"); | |
} | |
} elsif($ARGV[0] =~ '-m' | '--mass'){ | |
print "\n$p1\n\n"; | |
if(!$msg){ | |
print " MSG: "; $msg = <STDIN>; | |
} | |
$lista = $ARGV[1]; | |
$nome = $ARGV[2]; | |
$qnt = $ARGV[3]; | |
open(my $data, "<$lista") or die "$!"; | |
while(my $nmr = <$data>){ | |
open(my $data1, "<$nome") or die "$!"; | |
while(my $nom = <$data1>){ | |
chomp $nom; | |
chomp $nmr; | |
for (1..$qnt){ | |
system("echo '$nom, $msg' | gammu --sendsms TEXT $nmr"); | |
} | |
} | |
} | |
} else{ | |
print "\n$p1\n\n\t$p2\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment