Compare commits

..

No commits in common. "6021b912ff89a530749c411eaa87dc2e21b0e979" and "64af86c11e2b48550411c0cce58f0c237c5a72c9" have entirely different histories.

3 changed files with 9 additions and 9 deletions

View File

@ -91,7 +91,7 @@ The arguments are:
- `debug`: to have some feedback from the script execution. Useful for debugging - `debug`: to have some feedback from the script execution. Useful for debugging
- `force`: force refetch the rss feed and articles - `force`: force refetch the rss feed and articles
- `silent`: don't output the final RSS (useless on its own, but can be nice when debugging) - `silent`: don't output the final RSS (useless on its own, but can be nice when debugging)
- `newest`: return the feed items in chronological order (morss ohterwise shows the items by appearing order) - `first`: return the feed items in the order they initially appear in the feed (morss ohterwise shows the newest items first)
- http server only - http server only
- `callback=NAME`: for JSONP calls - `callback=NAME`: for JSONP calls
- `cors`: allow Cross-origin resource sharing (allows XHR calls from other servers) - `cors`: allow Cross-origin resource sharing (allows XHR calls from other servers)

View File

@ -343,14 +343,14 @@ def FeedGather(rss, url, options):
if options.cache: if options.cache:
max_time = 0 max_time = 0
if options.newest: if options.first:
# :newest take the newest items # :first to just take the first items in the feed (in sequence)
now = datetime.now(tz.tzutc()) sorted_items = rss.items
sorted_items = sorted(rss.items, key=lambda x:x.updated or x.time or now, reverse=True)
else: else:
# default behavior, take the first items (in appearing order) # otherwise, take the _newest_, i.e. sort by time
sorted_items = list(rss.items) now = datetime.now(tz.tzutc())
sorted_items = sorted(rss.items, key=lambda x:x.updated or x.time or now, reverse=True)
for i, item in enumerate(sorted_items): for i, item in enumerate(sorted_items):
if time.time() - start_time > lim_time >= 0 or i + 1 > lim_item >= 0: if time.time() - start_time > lim_time >= 0 or i + 1 > lim_item >= 0:

View File

@ -192,8 +192,8 @@
</select> </select>
link of the link of the
<select> <select>
<option value="">first</option> <option value="">newest</option>
<option value=":newest" title="Select feed items by publication date (instead of appearing order)">newest (?)</option> <option value=":first" title="Return the feed items in the order they appear in the feed (morss ohterwise shows the newest items first)">first (?)</option>
</select> </select>
items and items and
<select> <select>