By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

Script Request...

P: n/a
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.
Mar 19 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
some one wrote:
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
Mar 19 '08 #2

P: n/a
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 <64*************@mid.uni-berlin.de>, de***@nospam.web.de
says...
some one wrote:
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
Mar 19 '08 #3

P: n/a
some one wrote:
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
Mar 20 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.