Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page

by ravi teja (Initiate)
on Sep 11, 2014 at 14:11 UTC ( [id://1100305]=perlquestion: print w/replies, xml ) Need Help??

ravi teja has asked for the wisdom of the Perl Monks concerning the following question:

Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page. Please help how to select options like "Send free SMS" or "Start earnings"after login. Please find the code below that I tried

use WWW::Mechanize; use Compress::Zlib; use HTML::TokeParser; my $mech = WWW::Mechanize->new(); my $username = ""; my $keyword = ""; my ($text,$mobile); my @mobilenos; my $morenos = $ARGV[0]; @mobilenos = $morenos; print @mobilenos; $text = $ARGV[1]; $deb = 1; print "Total Character of message is ".length($text)."\n" if($deb); $text = $text."\n\n\n\n\n" if(length($text) < 135); $mech->get("http://wwwl.way2sms.com/content/index.html"); unless($mech->success()) { print "successed"; exit; } $dest = $mech->response->content; print "Fetching...\n" if($deb); if($mech->response->header("Content-Encoding") eq "gzip") { $dest = Compress::Zlib::memGunzip($dest); $mech->update_html($dest); } $dest =~ s/<form name="loginForm"/<form action='..\/Login1.action' nam +e="loginForm"/ig; $mech->update_html($dest); $mech->form_with_fields(("username","password")); $mech->field("username",$username); $mech->field("password",$keyword); print "Loggin...\n" if($deb); $mech->submit_form(); $dest= $mech->response->content; $mech->click_button(value => "Send Free SMS"); foreach $mobile (@mobilenos){ chomp($mobile); print "\nMessage sending to ".($mobile)."\n"; print "Sending ... \n" if($deb); $mech->field("Mobile Number",$mobile); $mech->field("Message",$text); $mech->click(value => "Send SMS"); if($mech->success()) { print "Done \n" if($deb); } else { print "Failed \n" if($deb); exit; } $dest = $mech->response->content; if($mech->response->header("Content-Encoding") eq "gzip") { $dest = Compress::Zlib::memGunzip($dest); } $x = $mech->content(); open(Myfile,'>',"rt.txt"); print Myfile $x; if($dest =~ m/successfully/sig) { print "Message sent successfully \n" if($deb); } } print "Message sent to all the numbers\n Bye.\n"; exit;
  • Comment on Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page
  • Download Code

Replies are listed 'Best First'.
Re: Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page
by ww (Archbishop) on Sep 11, 2014 at 14:48 UTC

    Have you logged in (presumably with a uname and pw? Are you registered?
    Or are you trying to freeload?

    I don't see any "Send Free SMS" button at the address in your code; only a para of self promotion with that as a headline (the code gets from a login/register page).


    check Ln42!

      I am trying to login with my credentials. But after login there will be a option "Send Free SMS". I am unable to figure out whether that is button or link. What ever method of Mechanize module as used it is not working. Can u plz chk and let me know how to select that option afetr login

        "... Can u plz chk and let me know...."

        Not just "No"; "Hell, no!"

        And were I inclined to oblige, you'd have to send me your credentials, which would violate that site's terms of use.

        If that sounds merely grumpy or unkind, consider the following:
            You can and should check for yourself... and -- given that you claim to have credentials -- you can use your browser's 'view source' option to find the html that's actually extant at the point you're having problems... after which, any number of tools discussed in nodes on this site, alone, will allow you to resolve the issue.

        On asking for help, How do I post a question effectively?, and, last but not least, I know what I mean. Why don't you?.

        Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
        1. code
        2. verbatim error and/or warning messages
        3. a coherent explanation of what "doesn't work actually means.
Re: Trying to send SMS from PC to Mobile but unable to select "Send Free SMS" button on the home page
by jonadab (Parson) on Sep 12, 2014 at 14:15 UTC

    Another way to accomplish this is to use the carrier's email-to-SMS gateway. For example, if the phone is on Verizon's network and has phone number 555-111-5555, you can use a module like Mail::Sendmail to send a message to 5551115555@vtext.com, and it will be received on the phone as a text message. I think all major cell carriers have such a gateway. The user on the phone can also reply, and the answer will go to the email address you used. (I'm not sure if it prioritizes the SMTP envelope address or the From: or Reply-To: address; I always just use the same address for all three.)

    I actually have a Perl script I wrote that, in addition to letting me send texts, also monitors my POP3 inboxes and watches for replies, then sends them to me as a /msg on IRC. I can then answer like /msg botname !sms Whoever blah blah blah, and my Perl script looks up Whoever in its database, gets the phone number and carrier, constructs the email, and sends it, and my sister (or whoever) gets it on her phone.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1100305]
Front-paged by GotToBTru
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found