From 2e19bdae2d34581cb3e2d73ec388d6609b878b5c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 9 Jan 2008 01:33:51 -0500 Subject: [PATCH] Pastebin RSS feed: limit number of posts --- extra/webapps/pastebin/pastebin.factor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index 0a7dc559c3..9492e9e5a1 100755 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -57,8 +57,11 @@ C: annotation : paste-link ( paste -- link ) paste-n number>string [ show-paste ] curry quot-link ; +: safe-head ( seq n -- seq' ) + over length min head ; + : paste-feed ( -- entries ) - get-pastebin pastebin-pastes [ + get-pastebin pastebin-pastes 20 safe-head [ { paste-summary paste-link