shrub/ren/rss-xml.hoon

58 lines
1.4 KiB
Plaintext
Raw Normal View History

:: Simple rss transformer
::
:::: /hoon/rss-xml/ren
::
2016-02-18 02:16:33 +03:00
/? 310
2016-11-11 02:36:03 +03:00
/= our /$ |=({bem/beam *} p.bem)
/= top
2016-11-11 03:20:49 +03:00
/. /= pax /$ |=({bem/beam *} (slag (lent /web) (flop s.bem)))
2016-11-11 02:36:03 +03:00
/= inf /% /&front&/|(/front/ /~[~])
==
/= kid /^ :(map knot knot cord)
/% /_ /front/
2016-02-18 02:16:33 +03:00
!:
:::: ~fyr, ~tasfyn-partyv
::
2016-11-11 02:36:03 +03:00
|%
++ relative-link
=/ external-host
~+(.^(hart %e /(scot %p our)/host/real))
|= a/path ^- tape
(earn external-host `(weld pax.top a) ~)
::
++ parse-front
|= 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) '')
==
2016-11-11 02:36:03 +03:00
--
::
2016-11-11 02:36:03 +03:00
::::
::
%- crip %- poxo
;rss(version "2.0")
;channel
2016-11-11 02:36:03 +03:00
;* =/ a (parse-front inf.top)
;=
;title: {(trip title.a)}
2016-11-11 02:36:03 +03:00
;link: {(relative-link /)}
;description: {(trip preview.a)}
==
;* %+ turn (~(tap by kid))
2016-11-11 02:36:03 +03:00
|= {fyl/@t inf/(map knot cord)}
=/ a (parse-front inf)
;item
2016-11-11 02:36:03 +03:00
;link: {(relative-link /[fyl])}
;title: {(trip title.a)}
;author: {(trip author.a)}
;description: {(trip preview.a)}
;* %- drop
%+ bind (slaw %da date.a)
|= b/@da ^- manx
2016-11-11 02:40:14 +03:00
[/'pubDate' ;/((dust (yore b))) ~]
==
==
==