0

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.

4

2 回答 2

1

我也会将我的评论粘贴到这里的答案中。

有很多方法可以解决,但我将首先关注设计决策问题。

为简单起见,创建两个页面。显示生成信息的第一页,没有生成的信息,只是样式和所有其他锦上添花。包括指向第二页的which,也就是生成的内容。

约翰的回答有一个很好的方法来解决手动运行脚本的问题:使用 cron。

于 2012-10-13T02:25:54.577 回答
1

几个选项之一:我认为这可能是最快/最简单的......

将 python 脚本上传到服务器。让它在 webroot 下创建/更新一个公开可读的文件。编写一些 javascript 以将该页面加载到您的 html 页面中。

如果您想通过 cron 定期运行脚本来获得花哨的计划。

于 2012-10-13T02:01:39.293 回答