drivel/rss.template

45 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

2020-10-29 18:43:12 +01:00
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
2020-10-30 10:21:27 +01:00
<title>Twitter</title>
2020-10-29 19:33:56 +01:00
<link>https://twitter.com</link>
<description>Twitter</description>
2020-10-29 18:43:12 +01:00
{{range $index, $post := .}}
<item>
2020-10-29 19:33:56 +01:00
<title>{{$post.User.Screen_name}} ({{$post.Id_str}})</title>
2020-10-29 18:43:12 +01:00
<content:encoded><![CDATA[
{{$status := $post}}
{{if $status.Retweeted_status}}
{{$status = $post.Retweeted_status}}
2020-10-30 07:46:07 +01:00
@{{$post.User.Screen_name}} ({{$post.Id_str}}) retweeted
2020-10-29 18:43:12 +01:00
{{end}}
{{$user := $status.User.Screen_name}}
@{{$user}} ({{$status.Id_str}}){{if $status.In_reply_to_status_id_str}} in reply to {{$status.In_reply_to_screen_name}} ({{$status.In_reply_to_status_id_str}}){{end}}: <br><br>
{{replaceAll $status.Text "\n" "<br>"}}
2020-10-29 18:43:12 +01:00
{{range $idxMedia, $media := $status.Extended_entities.Media}}
<br><a href="https://twitter.com/{{$user}}/status/{{$status.Id_str}}"><img src="{{$media.Media_url}}"></a>
{{end}}
{{if $status.Quoted_status}}
{{$quotedUser := $status.Quoted_status.User.Screen_name}}
<br><br>Quotes
2020-10-30 07:46:07 +01:00
@{{$quotedUser}} ({{$status.Quoted_status.Id_str}}): <br><br>{{$status.Quoted_status.Text}}
2020-10-29 18:43:12 +01:00
{{range $idxMedia, $media := $status.Quoted_status.Extended_entities.Media}}
<br><a href="https://twitter.com/{{$quotedUser}}/status/{{$status.Quoted_status.Id_str}}"><img src="{{$media.Media_url}}"></a>
{{end}}
{{end}}
]]></content:encoded>
<link>https://twitter.com/{{$user}}/status/{{$status.Id_str}}</link>
<guid>https://twitter.com/{{$user}}/status/{{$status.Id_str}}</guid>
<pubDate>{{$post.Created_at.Time.Format "Mon, 02 Jan 2006 15:04:05 -0700"}}</pubDate>
</item>
{{- end}}
</channel>
</rss>