Page 1 of 1

script-fu: check KG without ever leaving the command-line

Posted: Fri Jun 01, 2007 9:35 pm
by iblis

Code: Select all

#!/usr/bin/env python
import urllib, sys, xml.dom.minidom
address = 'http://www.knoxgothic.com/forum/rss.php'
document = xml.dom.minidom.parse(urllib.urlopen(address))
for item in document.getElementsByTagName('item'):
    title = item.getElementsByTagName('title')[0].firstChild.data
    url = item.getElementsByTagName('link')[0].firstChild.data
    print "Title: %s" % title.encode('latin-1','replace'),
    print "URL: %s" % url.encode('latin-1','replace')
* requires installation of python
** if you copy/paste this, remember that in python, indentation is very important. :mrgreen:

Posted: Fri Jun 01, 2007 9:42 pm
by Nephilim
bah, browse in Lynx!

Re: script-fu: check KG without ever leaving the command-line

Posted: Sun Dec 09, 2007 10:03 am
by ericmoritz
Ah python, my favorite language.
http://xkcd.com/353/

Re: script-fu: check KG without ever leaving the command-line

Posted: Sun Dec 09, 2007 11:28 am
by iblis
ericmoritz wrote:Ah python, my favorite language.
http://xkcd.com/353/
Yeah. I think I was hooked from my very first from future import __blah__

IronPython just made it better. .NET under Linux using Python? For me? woot!