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

A forum for the discussion of issues technical and computer.

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

Postby iblis » Fri Jun 01, 2007 9:35 pm

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
iblis
Don't click the iblis link!!!!
 
Posts: 4866
Joined: Wed Feb 19, 2003 7:19 pm

Postby Nephilim » Fri Jun 01, 2007 9:42 pm

bah, browse in Lynx!
NashvilleGothic.com - Administrator
Salvation in Nashville - co-founding DJ
User avatar
Nephilim
 
Posts: 303
Joined: Sun Mar 02, 2003 5:09 pm
Location: Nashvillistan

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

Postby ericmoritz » Sun Dec 09, 2007 10:03 am

Ah python, my favorite language.
http://xkcd.com/353/
ericmoritz
 
Posts: 4
Joined: Fri Nov 23, 2007 11:50 am

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

Postby iblis » Sun Dec 09, 2007 11:28 am

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
User avatar
iblis
Don't click the iblis link!!!!
 
Posts: 4866
Joined: Wed Feb 19, 2003 7:19 pm


Return to GothGeek

Who is online

Users browsing this forum: No registered users and 2 guests

cron