The "Hacker News" bug is fixed. Weirdo HN site doesn't publish guids or timestamps. Now bubbling priorities on ids. Also added 'j' and 'k' keyboard shortcuts. And fixed the escaping url bug on the Reader.

This commit is contained in:
Samuel Clay 2009-09-08 00:13:49 +00:00
parent 841b432c51
commit 2ac39549ae
4 changed files with 21 additions and 9 deletions

View file

@ -1,4 +1,5 @@
from django.db import models
from django.db import IntegrityError
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
@ -88,21 +89,21 @@ class Feed(models.Model):
if existing_story is None:
pub_date = datetime.datetime.timetuple(story.get('published'))
# logging.debug('- New story: %s %s' % (pub_date, story.get('title')))
s = Story(story_feed = self,
story_date = story.get('published'),
story_title = story.get('title'),
story_content = story_content,
story_author = story.get('author'),
story_permalink = story.get('link'),
story_guid = story.get('id')
story_guid = story.get('id') or story.get('link')
)
try:
ret_values[ENTRY_NEW] += 1
s.save(force_insert=True)
except:
except IntegrityError, e:
ret_values[ENTRY_ERR] += 1
pass
logging.error('Saving new story, IntegrityError: %s - %s: %s' % (self.feed_title, story.get('title'), e))
elif existing_story and story_has_changed:
# update story
logging.debug('- Updated story in feed (%s - %s): %s / %s' % (self.feed_title, story.get('title'), len(existing_story['story_content']), len(story_content)))
@ -127,13 +128,14 @@ class Feed(models.Model):
story_original_content = original_content,
story_author = story.get('author'),
story_permalink = story.get('link'),
story_guid = story.get('id')
story_guid = story.get('id') or story.get('link')
)
try:
ret_values[ENTRY_UPDATED] += 1
s.save(force_update=True)
except:
pass
except IntegrityError, e:
ret_values[ENTRY_ERR] += 1
logging.error('Saving updated story, IntegrityError: %s - %s' % (self.feed_title, story.get('title')))
else:
ret_values[ENTRY_SAME] += 1
# logging.debug("Unchanged story: %s " % story.get('title'))

View file

@ -77,6 +77,8 @@ a img {
text-decoration: none;
color: #272727;
line-height: 1.3em;
height: 1.2em;
overflow: hidden;
}
#feed_list .feed.no_unread_items .feed_title {

View file

@ -141,6 +141,14 @@
$(document).bind('keydown', { combi: 'up', disableInInput: true }, function(e) {
e.preventDefault();
self.show_next_story(-1);
});
$(document).bind('keydown', { combi: 'j', disableInInput: true }, function(e) {
e.preventDefault();
self.show_next_story(-1);
});
$(document).bind('keydown', { combi: 'k', disableInInput: true }, function(e) {
e.preventDefault();
self.show_next_story(1);
});
$(document).bind('keydown', { combi: 'left', disableInInput: true }, function(e) {
e.preventDefault();
@ -723,7 +731,7 @@
open_story_link: function(story_id, $st) {
var story = this.model.get_story(story_id);
window.open(story['story_permalink'], '_blank');
window.open(unescape(story['story_permalink']), '_blank');
window.focus();
},

View file

@ -91,7 +91,7 @@ class ProcessFeed:
logging.debug(u'[%d] Processing %s' % (self.feed.id,
self.feed.feed_title))
if hasattr(self.fpf, 'status'):
if self.options['verbose']:
logging.debug(u'[%d] HTTP status %d: %s' % (self.feed.id,