[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Update of Orange SMS script



People using my SendSMS script (or one of its derivatives) have probably
noticed that a couple of days ago the script stopped working for sending
Orange SMSs (Cellcom works as it did).

Don't worry - Orange did not stop its web SMS service - it only redesigned
the interface a bit, to use all sorts of funky JavaScripts, Flash, windows
and graphics. The redesign was very superficial (all the cookie machinery
for logging-in stayed the same), but it unfortunately broke my script
because I was checking for various string constants in the result to make
sure that the result was successful. These string constants had to be changed:
for example, what was once an HTTP redirection string, is now an ugly
Javascript redirection hack that I should look for in the result string.

Anyway, here's a patch for my script to make it work again for the current
Orange site. If people will have problems with it, I can post the entire
370 line script again. I also hope that the other people that released
derivatives of my script will release fixed versions.

P.S. There's a semantic change (at least I think it's a change - I don't
remember how it was before, because I'm a Cellcom user myself) in the
"sender" parameter. Orange now seems to ignore it unless it's a number.
When it is a number, it is displayed on the phone as the "sender", but when
it is not it is not displayed at all (the name used to open the SMS account
is used instead - I call my self mr. E. Mail ;)). I have no idea why Orange
does this - it's really very silly. But it means that if you used to
convey some important information in the "sender" string, you won't be able
to do it any more - just make the "message" string itself longer.

----------------------------------------------------------------------------

*** sendsms	2001/01/28 15:17:33	1.25
--- sendsms	2001/01/29 20:44:18
***************
*** 3,9 ****
  # SMS sending script for Cellcom and Orange Israeli cellular phones
  ##############################################################################
  #
! #Copyright (C) 1999-2000 Nadav Har'El
  #License: GNU GPL
  #
  ##############################################################################
--- 3,9 ----
  # SMS sending script for Cellcom and Orange Israeli cellular phones
  ##############################################################################
  #
! #Copyright (C) 1999-2001 Nadav Har'El
  #License: GNU GPL
  #
  ##############################################################################
***************
*** 296,302 ****
  ############################################################################
  } elsif($phonenum =~ m/^05[45][0-9][0-9][0-9][0-9][0-9][0-9]/){
  ############################ ORANGE ########################################
! 	# (using orange's own form. gosms.com (mivzak.com) is an alternative)
  	#die "Too many characters in message!\n" if length($message) > 108;
  	my $res;
          my $cookie_jar = HTTP::Cookies->new;
--- 296,304 ----
  ############################################################################
  } elsif($phonenum =~ m/^05[45][0-9][0-9][0-9][0-9][0-9][0-9]/){
  ############################ ORANGE ########################################
! 	# The following code uses Orange's "official" SMS sending form (changed
! 	# on Jan 26, 2001). An alternative is using orange.walla.co.il.
! 	# gosms.com (mivzak.com) also used to be an alternative.
  	#die "Too many characters in message!\n" if length($message) > 108;
  	my $res;
          my $cookie_jar = HTTP::Cookies->new;
***************
*** 316,322 ****
  	# get the cookies...
          $cookie_jar->extract_cookies($res);
  
! 	if($res->as_string !~ /Object moved.*smssend/s) {
  		print STDERR "Failed login into Orange: " . $res->status_line . "\n";
  		print STDERR $res->content. "\n";
  		print STDERR $res->as_string. "\n";
--- 318,326 ----
  	# get the cookies...
          $cookie_jar->extract_cookies($res);
  
! 	# Before Jan 26 2001, Oranges page used HTTP redirection. Later
! 	# version switched to Javascript redirection (argghh!)
! 	if($res->as_string !~ /document.location.href = 'smssend.asp'/s){
  		print STDERR "Failed login into Orange: " . $res->status_line . "\n";
  		print STDERR $res->content. "\n";
  		print STDERR $res->as_string. "\n";
***************
*** 335,342 ****
  	$cookie_jar->add_cookie_header($req);
  	$res = $ua->request($req);
  	## Check if the sending failed
! 	my $scs = "\347\354\371\360 \351\360\345\370\350\367\354\340\344"
! 	         ." \367\346\341\356\344";
  	if ($res->is_success) {
  		# TODO: check that the returned text is correct, then we'll
  		# be really sure the message was sent.
--- 339,345 ----
  	$cookie_jar->add_cookie_header($req);
  	$res = $ua->request($req);
  	## Check if the sending failed
! 	my $scs = "\361\356 \357\345\364\354\350\354 \347\354\371\360 SMS";
  	if ($res->is_success) {
  		# TODO: check that the returned text is correct, then we'll
  		# be really sure the message was sent.

-- 
Nadav Har'El                        |       Monday, Jan 29 2001, 6 Shevat 5761
nyh@math.technion.ac.il             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |If at first you don't succeed, skydiving
http://nadav.harel.org.il           |is not for you.

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il