nick_name
nick_name

Reputation: 1373

Simple News Feeds: Without Server-Side Languages

I have a news feed that I update periodically. I currently have the website regenerate the page based on a text file that just contains the title and text for that news update, using Python. Example:

1.This is a Title

This is some text that represents the news for today, etc. etc. I'm just typing things at this point to make this look like a paragraph.

2.This is a Title, Too

This is some text that represents the news for today, etc. etc. I'm just typing things at this point to make this look like a paragraph.

Is there a more elegant way to do this with some non PHP/server-side language?

Upvotes: 0

Views: 77

Answers (1)

fizzy drink
fizzy drink

Reputation: 682

have a look @ xml-parsing:

http://www.w3schools.com/xml/xml_parser.asp

The idea is as follows:

  • You first create an XML file which is your "news feed"
  • You then create an html page which uses javascript to parse the xmlfile and load it into DOM
  • You output the contents of the file

but why, if you are already using python, not create / read an xml file with python? or dynamically generate the file with python?

Upvotes: 1

Related Questions