news_text = all_stories[date]
h2date = date_to_str(time.gmtime(date)[:3])
index = open('index.html', 'a')
- if open('index.html', 'r').read().find(h2date) > -1:
+ if open('index.html', 'r').read().find('<h2>' + h2date + '</h2>\n\n') >= 0:
index.write(news_text)
else:
index.write('<h2>' + h2date + '</h2>\n\n')
news_text = "".join(stories_by_date[date])
h2date = date_to_str(time.gmtime(date)[:3])
index = open('index.html', 'a')
- if open('index.html', 'r').read().find(h2date) > -1:
+ if open('index.html', 'r').read().find('<h2>' + h2date + '</h2>\n\n') >= 0:
index.write(news_text)
else:
index.write('<h2>' + h2date + '</h2>\n\n')