سؤال

This seems like a very simple question, so I will remove if it's a repeat. I just can't seem to find the answer.

I'm using the feedparser module to parse an RSS feed. I want to post the output to a widget on a site. I don't want the python script to write the whole page. I just want to be able to get the output to the web page. Can anyone just point me in the right direction?

Details:

I have a blog that is run separately from the page that I would like to post the RSS Feed on. I have the script to parse the blog and generate the info I want. I want to get the generated output into an iframe or table or the like on a static HTML page. The static page is entirely separate from the blog.

هل كانت مفيدة؟

المحلول

One of several options: i'm thinking this might be quickest/easiest...

Upload the python script to the server. Have it create/update a publicly readable file under the webroot. Write some javascript to load that page into your html page.

If you want to get fancy schedule the script to run periodically via cron.

نصائح أخرى

I'll paste my comment into the answer here as well.

There are a lot of ways to go about it, but I'll focus on the design decision question first.

To make things simple, create two pages. First page for displaying the generated info without the generated info, just the styling and all other icing on the cake. Include an which point to the second page, which is the generated content.

John's answer has a good method of solving the problem of manually running the script: by using cron.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top