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

A forum for the discussion of issues technical and computer.
Post Reply
User avatar
iblis
Don't click the iblis link!!!!
Posts: 4866
Joined: Wed Feb 19, 2003 7:19 pm
Contact:

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

Post 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:
If carpenters made buildings the way programmers make programs, the first woodpecker to come along would destroy all of civilization. — Anonymous
User avatar
Nephilim
Posts: 303
Joined: Sun Mar 02, 2003 5:09 pm
Location: Nashvillistan
Contact:

Post by Nephilim »

bah, browse in Lynx!
NashvilleGothic.com - Administrator
Salvation in Nashville - co-founding DJ
User avatar
iblis
Don't click the iblis link!!!!
Posts: 4866
Joined: Wed Feb 19, 2003 7:19 pm
Contact:

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

Post 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!
If carpenters made buildings the way programmers make programs, the first woodpecker to come along would destroy all of civilization. — Anonymous
Post Reply
Users browsing this forum: No registered users and 2 guests