diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..edde7434d --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,22 @@ +The MIT License +=============== + +Copyright (c) 2009-2010 Samuel Clay . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 8670b11bc..1911b0f9c 100755 --- a/README.md +++ b/README.md @@ -1,33 +1,46 @@ -# Objective # +NEWSBLUR +======== A News/RSS Reader that controls the amount, relevancy, and interestingness of news subscriptions. -# Roadmap # +Roadmap +------- ## version 1.0 ## *Spring 2010* -* Feed management: Adding, removing, sorting/threading, OPML import -* Original view: Show the original site and connect stories to rss stories -* Feed view: Show all feed entries connected to rss stories -* Intelligence: Red/Yellow/Green for Bad/Neutral/Good stories. Based on explicit user preferences. + * Feed management: Adding, removing, sorting/threading, OPML import + * Original view: Show the original site and connect stories to rss stories + * Feed view: Show all feed entries connected to rss stories + * Intelligence: Red/Yellow/Green for Bad/Neutral/Good stories. Based on explicit user preferences. ## version 1.5 ## *Summer 2010* -* Google Reader import + * Google Reader import ## version 2.0 ## *Winter 2010* -* Search -* Feed discovery, ala *Give Me Something To Read* + * Search + * Feed discovery, ala *Give Me Something To Read* ## version 3.0 ## *Spring 2011* * Artificial intelligence: implicit behavior creates assumptions about stories + + +Author +------ + + * Samuel Clay + +License +------- + +NewsBlur is licensed under the MIT License. (See LICENSE) \ No newline at end of file diff --git a/apps/reader/views.py b/apps/reader/views.py index 70d90ed4c..8bfccc5b9 100644 --- a/apps/reader/views.py +++ b/apps/reader/views.py @@ -251,7 +251,7 @@ def load_feed_page(request): feed_page, created = FeedPage.objects.get_or_create(feed=feed) if not created: data = feed.feed_page.page_data - else: + if created or not data: data = "Give it 5-10 minutes...

Your feed will be here in under 5 minutes (on average).
Soon there will be a progress bar. Until then, take a deep breath." return HttpResponse(data, mimetype='text/html') diff --git a/apps/rss_feeds/models.py b/apps/rss_feeds/models.py index 86a755909..21e8f87b8 100644 --- a/apps/rss_feeds/models.py +++ b/apps/rss_feeds/models.py @@ -21,9 +21,9 @@ ENTRY_NEW, ENTRY_UPDATED, ENTRY_SAME, ENTRY_ERR = range(4) class Feed(models.Model): feed_address = models.URLField(max_length=255, verify_exists=True, unique=True) - feed_link = models.URLField(max_length=200, default="") - feed_title = models.CharField(max_length=255, default="") - feed_tagline = models.CharField(max_length=1024, default="") + feed_link = models.URLField(max_length=200, default="", blank=True, null=True) + feed_title = models.CharField(max_length=255, default="", blank=True, null=True) + feed_tagline = models.CharField(max_length=1024, default="", blank=True, null=True) active = models.BooleanField(default=True) num_subscribers = models.IntegerField(default=0) last_update = models.DateTimeField(auto_now=True, default=0) @@ -323,15 +323,18 @@ class Feed(models.Model): # Use stories per month to calculate next feed update updates_per_day = max(30, self.stories_per_month) / 30.0 # 1 update per day = 12 hours - # > 1 update per day = 30 minutes - minutes_to_next_update = 30 + # > 1 update per day: + # 2 updates = 1.5 hours + # 4 updates = 45 minutes + # 10 updates = 18 minutes + minutes_to_next_update = 12 * 60 / (updates_per_day * 4) if updates_per_day <= 1: minutes_to_next_update = 60 * 12 - random_factor = random.randint(0,int(minutes_to_next_update/4)) - slow_punishment = 0 + random_factor = random.randint(0,int(minutes_to_next_update/6)) # 6 hours / subscribers. Lots of subscribers = lots of updates subscriber_bonus = 6 * 60 / max(1, self.num_subscribers) + slow_punishment = 0 if 30 <= self.last_load_time < 60: slow_punishment = self.last_load_time elif 60 <= self.last_load_time < 100: diff --git a/media/js/newsblur/reader.js b/media/js/newsblur/reader.js index 4bf0c0908..9b4400a21 100644 --- a/media/js/newsblur/reader.js +++ b/media/js/newsblur/reader.js @@ -813,6 +813,10 @@ story = this.model.get_story($story.data('story')); NEWSBLUR.log(['now story', story, $story]); } + if (!story || !$story || !$story.length) { + return; + } + // NEWSBLUR.log(['scroll_to_story_in_story_feed', story, $story]); if ($story && $story.length) { diff --git a/utils/feed_fetcher.py b/utils/feed_fetcher.py index 8cc816adc..fda3b0556 100644 --- a/utils/feed_fetcher.py +++ b/utils/feed_fetcher.py @@ -312,7 +312,7 @@ class Dispatcher: else: comment = u'' - feed.last_load_time = delta.seconds + feed.last_load_time = max(1, delta.seconds) feed.save() done_msg = (u'%2s ---> Processed %s (%d) in %s\n ---> [%s] [%s]%s' % (