urbit/ren/rss-xml.hoon

50 lines
1.3 KiB
Plaintext
Raw Normal View History

:: Simple rss transformer
::
:::: /hoon/rss-xml/ren
::
2016-02-18 02:16:33 +03:00
/? 310
/= sum /% /&front&/|(/front/ /~[~])
/= kid /^ :(map knot knot cord)
/% /_ /front/
2016-02-18 02:16:33 +03:00
/$ |=({bem/beam *} [our=p.bem tub=(slag 1 (flop s.bem))])
!:
:::: ~fyr, ~tasfyn-partyv
::
2016-02-26 04:22:03 +03:00
::~& [sum=sum kid=kid]
:: Link from relative path
2016-02-26 04:22:03 +03:00
=+ hok=.^(hart %e /(scot %p our)/host/real)
2016-02-18 02:16:33 +03:00
=+ ref=|=(a/path (earn hok `(weld tub a) ~))
=/ atrs
|= a/(map cord cord)
:* title=(fall (~(get by a) %title) '')
preview=(fall (~(get by a) %preview) '')
author=(fall (~(get by a) %author) '')
date=(fall (~(get by a) %date) '')
==
::
%- crip %- poxo
;rss(version "2.0")
:: ;raw: *{(turn (wash 0^80 >% .<) |=(a/tape ;l:"{a}"))}
;channel
;* =/ a (atrs sum)
;=
;title: {(trip title.a)}
;link: {(ref /)}
;description: {(trip preview.a)}
==
;* %+ turn (~(tap by kid))
|= {nom/@t som/(map knot cord)}
=/ a (atrs som)
;item
;link: {(ref /[nom])}
;title: {(trip title.a)}
;author: {(trip author.a)}
;description: {(trip preview.a)}
;* %- drop
%+ bind (slaw %da date.a)
|= b/@da ^- manx
;date:"{(dust (yore b))}"
==
==
==