news4 - RSS aggrigation system
修訂 | 0dbb52df1d530db7b6a7d8259e866d95f4850396 (tree) |
---|---|
時間 | 2013-04-26 03:41:05 |
作者 | hylom <hylom@hylo...> |
Commiter | hylom |
Merge branch 'live'
@@ -4,7 +4,7 @@ include install.conf | ||
4 | 4 | DEPENDS=install.conf |
5 | 5 | |
6 | 6 | all: install.conf keywords.py |
7 | - python gnews.py | |
7 | + LANG=ja_JP.UTF-8 python gnews.py | |
8 | 8 | |
9 | 9 | install: install.conf |
10 | 10 | rsync -av css/ $(INSTALL_DIR)/css |
@@ -18,11 +18,15 @@ class FeedFetcher(object): | ||
18 | 18 | f = feedparser.parse(self._feed["source"]) |
19 | 19 | entries = [] |
20 | 20 | for e in f['entries']: |
21 | + try: | |
22 | + desc = e.description | |
23 | + except AttributeError: | |
24 | + desc = '' | |
21 | 25 | entry = { |
22 | 26 | # 'title': e.title.decode('utf8') if isinstance(e.title, str) else e.title, |
23 | 27 | 'title': e.title, |
24 | 28 | 'url': e.link, |
25 | - 'body': e.description, | |
29 | + 'body': desc, | |
26 | 30 | 'date': dateutil.parser.parse(e.updated), |
27 | 31 | 'feed': self._feed, |
28 | 32 | 'tags': [], |
@@ -6,6 +6,19 @@ | ||
6 | 6 | <!-- Bootstrap --> |
7 | 7 | <link href="${site.css_directory}/bootstrap.min.css" rel="stylesheet"> |
8 | 8 | <link href="${site.css_directory}/gnews.css" rel="stylesheet"> |
9 | +<script type="text/javascript"> | |
10 | + var _gaq = _gaq || []; | |
11 | + _gaq.push(['_setAccount', 'UA-739864-13']); | |
12 | + _gaq.push(['_trackPageview']); | |
13 | + (function() { | |
14 | + var ga = document.createElement('script'); ga.type = | |
15 | +'text/javascript'; ga.async = true; | |
16 | + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : | |
17 | +'http://www') + '.google-analytics.com/ga.js'; | |
18 | + var s = document.getElementsByTagName('script')[0]; | |
19 | +s.parentNode.insertBefore(ga, s); | |
20 | + })(); | |
21 | +</script> | |
9 | 22 | </head> |
10 | 23 | |
11 | 24 | <body class="wrap"> |
@@ -13,15 +26,15 @@ | ||
13 | 26 | |
14 | 27 | <!-- タイトル --> |
15 | 28 | <div class="row" id="site-header"> |
16 | - <div class="span9"> | |
29 | + <div class="span8"> | |
17 | 30 | <header> |
18 | 31 | <a href="${site.root}"> |
19 | 32 | <img id="sitelogo" src="${site.img_directory}/themesjp.png" alt="Themes.JP"> α |
20 | 33 | </a> |
21 | 34 | </header> |
22 | 35 | </div> |
23 | - <div class="span3 last-update"> | |
24 | - last update: ${date_format(site.last_update)} | |
36 | + <div class="span4 last-update"> | |
37 | + last update: ${date_format(site.last_update)}(GMT) | |
25 | 38 | </div> |
26 | 39 | </div> |
27 | 40 |