LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-05-2006, 06:38 AM   #1
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Rep: Reputation: 47
Slack server IM to cell phone?


My Slackware 11 server is always connected to the internet with a DSL router. I have an old Nokia 1100 Tracfone that is able to get text messages. I found a site that can IM my cell phone over the net. What I want to do is have my Slacware box grab weather info each day and then IM that info to my cell. Is this possible?
 
Old 11-05-2006, 12:08 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I don't know if your service is similar, but with my cellphone provider, text messages are handled just like email.

There is a domain (vtext.com, I think). And you just send an email to the number with the domain tacked on, like 12345678@vtext.com.

If that is the case for you as well, then you can sent email out to the phone with a simple script. For example, I have used this script to send HDD usage text messages to my phone by just plugging in the appropriate email address.

Code:
#!/usr/bin/perl
#
# Script to check HDD use and mail to to an address.

$HOST=`cat /etc/HOSTNAME`;
chomp($HOST);
@retval=`df -h`;
$dt=`date`;
chomp($dt);
open(MAIL,"|/usr/lib/sendmail -t");
print MAIL "From: diskusage\@mydomain.com\n";
print MAIL "To: me\@mydomain.com\n";
print MAIL "Subject: Disk Space ($HOST)\n";
print MAIL "\n";
print MAIL "@retval\n\n";
print MAIL "$HOST\n";
close (MAIL);
 
Old 11-05-2006, 04:03 PM   #3
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
thanks for that script. Now I need to figure out how to IM my cell with Tracfone. 1234567890@tracfone.com doesn't work. This site will IM Tracfones:

http://jasonholm.com/tracfone.html

Any idea how it works or if I could incorporate it into that script for Slackware Linux?

EDIT: Also, it's an sms service.

Last edited by linuxhippy; 11-05-2006 at 04:23 PM.
 
Old 11-05-2006, 04:42 PM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Maybe check curl

Code:
curl -d 'p_number=0123456789' \
-d 'message=Type Your Message Here' \
-d 'name=Your Name Here' \
http://jasonholm.com/cgi-bin/tracfone.cgi > result.html
Then see if the message was sent ok with the result.html...

Last edited by keefaz; 11-05-2006 at 05:01 PM. Reason: forget the name field...
 
Old 11-05-2006, 05:01 PM   #5
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
Success! I changed the phone # line to this

curl -d 'phonenumber=0123456789' \

The message size is limited to 160 characters. Any idea how to strip a 160 characters of text off a weather site and enter this into that script?
 
Old 11-05-2006, 05:07 PM   #6
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Glad it worked, I made a confusion between the name
and the phone number field id

For limited length, you could use bash expansion
Code:
message='very long message here...'
message=${message:0:160}
 
Old 11-05-2006, 05:59 PM   #7
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
Here's a nice 3 day forecast in text...the banners and html need to be stripped. How could I do this and then put the resulting text file in the message field and then use the above limit of 160?

http://www.weather.com/weather/narra...nav_undeclared

EDIT:

Here's an all text forecast that wget won't get (not sure why):

http://www.erh.noaa.gov/forecast/Map...PHI&TextType=1

Last edited by linuxhippy; 11-05-2006 at 06:18 PM.
 
Old 11-05-2006, 07:21 PM   #8
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
For easy html stripping, I suggest :
Code:
lynx -dump http://www.weather.com/weather/narra...nav_undeclared
For the text forecast that wget won't get, I don't know it said :
'You have entered an invalid station id. An error has occurred. Exiting the script!'
I don't know, maybe it wants hidden field value or cookies, or something wrong
in the url variables...
 
Old 11-06-2006, 06:41 PM   #9
linuxhippy
Senior Member
 
Registered: Sep 2004
Location: Philadelphia, PA
Distribution: Xubuntu, Mythbuntu, Lubuntu, Picuntu, Mint 18.1, Debian Jessie
Posts: 1,207

Original Poster
Rep: Reputation: 47
nice-I didn't know that lynx could do a dump. I did this:

lynx -dump http://www.weather.com/weather/narra...nav_undeclared > forecast

How can I have curl enter this forecast file into the message area?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need new cell phone rmakers General 0 08-16-2006 10:51 AM
cell phone as modem John2005 Linux - Networking 1 08-05-2006 09:36 PM
Use cell phone as modem Oxagast Linux - Software 4 05-02-2006 12:16 AM
Linux and Cell Phone futurist Linux - Software 2 06-24-2003 03:29 AM
cell-phone to modem sparker1968 Slackware 0 04-12-2003 12:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration