[[\
"""This Webfrontend is written in Spyce (Python Server Pages/http://spyce.sourceforge.net) and needs the file feedfinder.py from Mark Pilgrim.
Download it from http://diveintomark.org/projects/feed_finder/feedfinder.py .

You can test this script at http://www.goermezer.de
"""
]]

<html>
<head><title>RSS Feedfinder</title></head>
<body>
[[\
if request.getpost1('url') != None:
  print '<h1><center>RSS Feed results for', request.getpost1('url'), '</center></h1>'
else:
  print '''<h1><center>Newsfeed finder</center></h1>
<p><center>This search engine searches for RSS feeds starting at any toplevel URL and crawls the whole site.</center></p>'''
]]
<form method=get action="[[=request.uri('path')]]">
<center>
<table>
  <tr>
    <td>Main URL of site:</td>
   <td><input class="searchbox" name="url" type=text value="python.org" onBlur="if(this.value=='') this.value='python.org';" onFocus="if(this.value=='python.org') this.value='';"</td>
    <td><input type=submit value="Submit"></td>
  </tr>
</table>
</form>
<hr><br>
<%\
url = request.getpost1('url')
if url != None:
    import feedfinder
    result=feedfinder.getFeeds(url)
    length = len(result)
    if result ==[]:
        print '<b>Sorry, no RSS Feed found.</b>'
    else:
        print '<b>Result:</b>'
        for i in range(length):
            print '<b><a href="'+result[i]+'">'+result[i]+'</a></b><br><br>'
        print """<p>
</p>"""
]]
</center>
</body></html>