rss template

This commit is contained in:
gutmet 2020-10-29 18:00:06 +01:00
parent 50339f7a18
commit 77da673c5d

41
rss.template Normal file
View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>$$USERNAME$$</title>
<link>https://twitter.com/$$USERNAME$$</link>
<description>$$USERNAME$$</description>
{{range $index, $post := .}}
<item>
<title>{{$post.Id_str}}</title>
<content:encoded><![CDATA[
{{$status := $post}}
{{if $status.Retweeted_status}}
{{$status = $post.Retweeted_status}}
RT
{{end}}
@{{$status.User.Screen_name}}: <br><br>{{$status.Text}}
{{range $idxMedia, $media := $status.Extended_entities.Media}}
<a href="https://twitter.com/$$USERNAME$$/status/{{$post.Id_str}}"><img src="{{$media.Media_url}}"></a>
{{end}}
{{if $status.Quoted_status}}
<br><br>Quotes
@{{$status.Quoted_status.User.Screen_name}}: <br><br>{{$status.Quoted_status.Text}}
{{range $idxMedia, $media := $status.Quoted_status.Extended_entities.Media}}
<a href="https://twitter.com/$$USERNAME$$/status/{{$post.Id_str}}"><img src="{{$media.Media_url}}"></a>
{{end}}
{{end}}
]]></content:encoded>
<link>https://twitter.com/$$USERNAME$$/status/{{$post.Id_str}}</link>
<guid>https://twitter.com/$$USERNAME$$/status/{{$post.Id_str}}</guid>
<pubDate>{{$post.Created_at.Time.Format "Mon, 02 Jan 2006 15:04:05 -0700"}}</pubDate>
</item>
{{- end}}
</channel>
</rss>