Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 19th, 2008, 11:55 AM
some one
Guest
 
Posts: n/a
Default Script Request...

Hi all, I am not to familiar with python yet and I am wondering if
someone can write a script that will monitor my DSL modems IP address
and notify when it changes, its a 2Wire Advanced DSL Modem. I need to
know when it changes because I am trying to run my own inhouse server
and have to update my domain records through verio.com.

The script would need to read the text of a web page( on my modem the
address is http://192.168.0.1/xslt?PAGE=B01&THISPAGE=&NEXTPAGE=B01 ) and
search for a string containing the IP address.

Can anyone help?
thanks, I'll keep monitoring this thread.
  #2  
Old March 19th, 2008, 12:45 PM
Diez B. Roggisch
Guest
 
Posts: n/a
Default Re: Script Request...

some one wrote:
Quote:
Hi all, I am not to familiar with python yet and I am wondering if
someone can write a script that will monitor my DSL modems IP address
and notify when it changes, its a 2Wire Advanced DSL Modem. I need to
know when it changes because I am trying to run my own inhouse server
and have to update my domain records through verio.com.
>
The script would need to read the text of a web page( on my modem the
address is http://192.168.0.1/xslt?PAGE=B01&THISPAGE=&NEXTPAGE=B01 ) and
search for a string containing the IP address.
>
Can anyone help?
thanks, I'll keep monitoring this thread.
Try urllib2 to fetch the data, use either string-search, regular expressions
or even BeautifulSoup to extract the data. Use a cron-job to do that on a
regular base or use module time.sleep() together with an endless loop to
monitor that location periodically.

Show us your concrete efforts, and we will suggest improvements.

Diez
  #3  
Old March 19th, 2008, 10:35 PM
some one
Guest
 
Posts: n/a
Default Re: Script Request...

Thanks Diez, I found some docs and examples on urllib2. Now how do i
search the string I get from urllib2, lets say I put it in "myURL", How
do I search for only Numbers and ".'s" in the "#.#.#.#" pattern. That
is all I am interested in with all the data retrieved. Just the IP
Address from amongst a bunch of data that I have no use of currently.

I would I write a pattern matching function to extract only the IP
address from "myURL"?

In article <64ccfbF2bbfckU1@mid.uni-berlin.de>, deets@nospam.web.de
says...
Quote:
some one wrote:
>
Quote:
Hi all, I am not to familiar with python yet and I am wondering if
someone can write a script that will monitor my DSL modems IP address
and notify when it changes, its a 2Wire Advanced DSL Modem. I need to
know when it changes because I am trying to run my own inhouse server
and have to update my domain records through verio.com.

The script would need to read the text of a web page( on my modem the
address is http://192.168.0.1/xslt?PAGE=B01&THISPAGE=&NEXTPAGE=B01 ) and
search for a string containing the IP address.

Can anyone help?
thanks, I'll keep monitoring this thread.
>
Try urllib2 to fetch the data, use either string-search, regular expressions
or even BeautifulSoup to extract the data. Use a cron-job to do that on a
regular base or use module time.sleep() together with an endless loop to
monitor that location periodically.
>
Show us your concrete efforts, and we will suggest improvements.
>
Diez
>
  #4  
Old March 20th, 2008, 10:55 AM
Diez B. Roggisch
Guest
 
Posts: n/a
Default Re: Script Request...

some one wrote:
Quote:
Thanks Diez, I found some docs and examples on urllib2. Now how do i
search the string I get from urllib2, lets say I put it in "myURL", How
do I search for only Numbers and ".'s" in the "#.#.#.#" pattern. That
is all I am interested in with all the data retrieved. Just the IP
Address from amongst a bunch of data that I have no use of currently.
>
I would I write a pattern matching function to extract only the IP
address from "myURL"?
Pattern-matching can be done using regular expressions, they are available
in the module "re".

Diez
 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles