473,382 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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.
Mar 19 '08 #1
3 1378
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Paul Winkler | last post by:
This is driving me up the wall... any help would be MUCH appreciated. I have a module that I've whittled down into a 65-line script in an attempt to isolate the cause of the problem. (Real...
1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
5
by: Boris Nikolaevich | last post by:
This is backwards of what I usually want--normally if you have a long-running ASP script, it's a good idea to check to see whether the client is still connected so you can cancel execution. ...
0
by: Mark Griffin | last post by:
Hi... I am trying to convert a simple FAQ script to access mysql db rather than the Access db it was designed for. The originators of the script offer no support at all. I have managed to set...
1
by: pmclinn | last post by:
The code below is generated by an application that allows you to put a Microsoft assistant on a webpage. I'm having a heck of a time trying to get this script to launch on a server side button...
5
by: Moskie | last post by:
I recently came across an application where the 'src' attribute of a script tag was an ASPX file. Like so: <script language="JavaScript" src="scriptfile.aspx"></script> This is a new idea for...
0
by: David R. | last post by:
I found a script that converts a regular size image to a thumbnail. It's a wonderful script, except the thumbnail quality is a bit low. I'd like to add the following code to improve the output...
0
by: David R. | last post by:
I found a script that converts a regular size image to a thumbnail. It's a wonderful script, except the thumbnail quality is a bit low. I'd like to add the following code to improve the output...
1
by: David R. | last post by:
I found a script that converts a regular size image to a thumbnail. It's a wonderful script, except the thumbnail quality is a bit low. I'd like to add the following code to improve the output...
5
by: sandipon | last post by:
I have used the following Pagination script to display database records in a series of pages, but only the first page shows up properly, and on clicking the links of subsequent pages or the NEXT ,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.