Skip to content

Instantly share code, notes, and snippets.

@shawwn
Created July 29, 2026 14:26
Show Gist options
  • Select an option

  • Save shawwn/e187bbcfffdfb237d098047dee683650 to your computer and use it in GitHub Desktop.

Select an option

Save shawwn/e187bbcfffdfb237d098047dee683650 to your computer and use it in GitHub Desktop.
(mac margin args
(tostring
(each (kind val) (pair args)
(pr "margin-" kind ":" val ";"))))
(newsop from (site kind next)
(with (stories (items-from site metastory)
comments (items-from site acomment))
(w/the listpage-body
{tag (div style (margin left 36px top 6px bottom 12px))
(w/bars
(link (plural (len stories) "submission")
(fromurl site nil "story"))
(link (plural (len comments) "comment")
(fromurl site nil "comment")))}
(let kind (saferead (or kind "story"))
(listpage (msec)
(case kind
story stories
comment comments)
"from"
(string (when (is kind 'story)
"Submissions from ")
site)
(fromurl site) nil
[fromurl site _])))))
(def fromurl (site (o next arg!next) (o kind arg!kind))
(whenceurl
(string "from?" (if site "site=") (only&urlencode site)
(if (or kind next) "&kind=@(or kind "story")"))
(only&string next)))
(def items-from (site test)
(visible (keep test (map item (sitename->items* site)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment