I'm trying to make a basic RSS feed generator. I'm still a newb and I really need help. My aim is to have the user input all their desired settings then create an XML file in the same directory with all of their RSS settings.
First I'd like it to ask the user how many articles it wants to put in the RSS feed. So it can loop the adding articles bit that many times. Then after the user inputting all their desired options, for it to display, then save.
So far I have this, which is absolute rubbish. It looks horrendous and I think it is...How can I go about doing what I actually want to do?
First I'd like it to ask the user how many articles it wants to put in the RSS feed. So it can loop the adding articles bit that many times. Then after the user inputting all their desired options, for it to display, then save.
So far I have this, which is absolute rubbish. It looks horrendous and I think it is...How can I go about doing what I actually want to do?
Code:
#!/usr/bin/env python
print "Welcome please fill in these details about your websites feed:"
name=raw_input("Name of Feed:")
desc=raw_input("Description of Feed:")
url=raw_input("Location of Website:")
print "Your websites details have been temporarilly stored for this session, now fill in your articles details:"
aname=raw_input("Name of Article to Syndicate:")
adesc=raw_input("Description of Article to Syndicate:")
aurl=raw_input("URL of Article:")
print "Your article details have been filled in, please wait..."
print "Your XML code for this Feed is:"
print """<?xml version="1.0" encoding="ISO-8859-1" ?> \n
<rss version="0.91">\n"""
print """<channel>\n
<title>"""
print name
print """</title> \n
<link>"""
print url
print """</link>
\n <description>"""
print desc
print """</description> \n
<item><title>"""
print aname
print """</title">\n
<link>"""
print aurl
print """</link>\n <description>"""
print adesc
print """</description>\n
</item>\n
</channel>\n
</rss>"""
Comment