#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
import cgi
import string
import feedparser
count = 0
print "Content-Type: text/html\n\n"
print """<PRE><B>WORK MAINTENANCE/B></PRE>"""
d = feedparser.parse("http://www.hep.hr/ods/rss/radovi.aspx?dp=zagreb")
for opis in d:
try:
print """<B>Place/Time:</B> %s<br>""" % d.entries[count].title
print """<B>Streets:</B> %s<br>""" % d.entries[count].description
print """<B>Published:</B> %s<br>""" % d.entries[count].date
print "<br>"
count+= 1
except:
pass
CGI とペイソン スクリプトに問題があります。端末スクリプトの下では、「IndexError: list index out of range」を除いて問題なく実行されます。そのためのパスを入れました。しかし、CGI を介してスクリプトを実行すると、WORK MAINTENANCE 行と d.entries[count].title の最初の行だけが 9 回繰り返されますか? とても紛らわしい...
また、フィードパーサーで Croation(balkan) レターのサポートを設定するにはどうすればよいですか? č,ć,š,ž,đ ? # - - コーディング: utf-8 - - が機能せず、Ubuntu サーバーを実行しています。
よろしくお願いします。
よろしく。