Watch That Post

Discussion in 'Python' started by =?iso-8859-1?q?Premshree=20Pillai?=, May 9, 2004.

  1. =?iso-8859-1?q?Premshree=20Pillai?=, May 9, 2004
    #1
    1. Advertising

  2. =?iso-8859-1?q?Premshree=20Pillai?=

    Steven Guest

    Premshree Pillai wrote:

    > Hello,
    >
    > I recently posted a simple Python script--Watch That
    > Post--that lets you watch a URL for any changes.
    >
    > I wrote it to watch posts on LiveJournal, but it can
    > watch any URL.
    >
    > It's at http://premshree.seacrow.com/code/python/watch



    I tried running it. It works fine until it tries to run the watch function a
    second time, then it does this:

    Traceback (most recent call last):
    File "watch.py", line 76, in ?
    watch()
    File "watch.py", line 58, in watch
    size2 = len(urllib.urlopen(url).readlines())
    File "/usr/lib/python2.3/urllib.py", line 76, in urlopen
    return opener.open(url)
    File "/usr/lib/python2.3/urllib.py", line 181, in open
    return getattr(self, name)(url)
    File "/usr/lib/python2.3/urllib.py", line 410, in open_file
    return self.open_local_file(url)
    File "/usr/lib/python2.3/urllib.py", line 420, in open_local_file
    raise IOError(e.errno, e.strerror, e.filename)
    IOError: [Errno 2] No such file or directory: 'www.kde-apps.org'

    I really like the idea,

    Steven
     
    Steven, May 10, 2004
    #2
    1. Advertising

  3. =?iso-8859-1?q?Premshree=20Pillai?=

    Peter Otten Guest

    Steven wrote:

    > Premshree Pillai wrote:
    >
    >> Hello,
    >>
    >> I recently posted a simple Python script--Watch That
    >> Post--that lets you watch a URL for any changes.
    >>
    >> I wrote it to watch posts on LiveJournal, but it can
    >> watch any URL.
    >>
    >> It's at http://premshree.seacrow.com/code/python/watch

    >
    >
    > I tried running it. It works fine until it tries to run the watch function
    > a second time, then it does this:
    >
    > Traceback (most recent call last):
    > File "watch.py", line 76, in ?
    > watch()
    > File "watch.py", line 58, in watch
    > size2 = len(urllib.urlopen(url).readlines())
    > File "/usr/lib/python2.3/urllib.py", line 76, in urlopen
    > return opener.open(url)
    > File "/usr/lib/python2.3/urllib.py", line 181, in open
    > return getattr(self, name)(url)
    > File "/usr/lib/python2.3/urllib.py", line 410, in open_file
    > return self.open_local_file(url)
    > File "/usr/lib/python2.3/urllib.py", line 420, in open_local_file
    > raise IOError(e.errno, e.strerror, e.filename)
    > IOError: [Errno 2] No such file or directory: 'www.kde-apps.org'
    >
    > I really like the idea,
    >
    > Steven


    Try to provide the protocol:

    >>> import urllib
    >>> urllib.urlopen("www.kde-apps.org")

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/usr/local/lib/python2.3/urllib.py", line 76, in urlopen
    return opener.open(url)
    File "/usr/local/lib/python2.3/urllib.py", line 181, in open
    return getattr(self, name)(url)
    File "/usr/local/lib/python2.3/urllib.py", line 410, in open_file
    return self.open_local_file(url)
    File "/usr/local/lib/python2.3/urllib.py", line 420, in open_local_file
    raise IOError(e.errno, e.strerror, e.filename)
    IOError: [Errno 2] No such file or directory: 'www.kde-apps.org'
    >>> urllib.urlopen("http://www.kde-apps.org")

    <addinfourl at 1078699980 whose fp = <socket._fileobject object at
    0x404b47d4>>
    >>>


    (Just a guess)

    Peter
     
    Peter Otten, May 10, 2004
    #3
  4. =?iso-8859-1?q?Premshree=20Pillai?=

    Matt Leslie Guest

    Steven wrote:
    >
    > I tried running it. It works fine until it tries to run the watch function a
    > second time, then it does this:
    >
    > Traceback (most recent call last):
    > File "watch.py", line 76, in ?
    > watch()
    > File "watch.py", line 58, in watch
    > size2 = len(urllib.urlopen(url).readlines())
    > File "/usr/lib/python2.3/urllib.py", line 76, in urlopen
    > return opener.open(url)
    > File "/usr/lib/python2.3/urllib.py", line 181, in open
    > return getattr(self, name)(url)
    > File "/usr/lib/python2.3/urllib.py", line 410, in open_file
    > return self.open_local_file(url)
    > File "/usr/lib/python2.3/urllib.py", line 420, in open_local_file
    > raise IOError(e.errno, e.strerror, e.filename)
    > IOError: [Errno 2] No such file or directory: 'www.kde-apps.org'
    >
    > I really like the idea,
    >
    > Steven


    The URLs in the url file need to start with http://

    Matt
     
    Matt Leslie, May 10, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manfred Balik

    realazing a watch

    Manfred Balik, Nov 25, 2004, in forum: VHDL
    Replies:
    4
    Views:
    602
    Hal Murray
    Nov 26, 2004
  2. PJ

    Watch Http Request/Responses

    PJ, Aug 16, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,374
    Ken Cox [Microsoft MVP]
    Aug 16, 2003
  3. Brad
    Replies:
    8
    Views:
    386
  4. et

    Add Watch

    et, Nov 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,869
  5. Kevin Spencer

    Words to Watch Out For

    Kevin Spencer, May 20, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    360
Loading...

Share This Page