aboutsummaryrefslogtreecommitdiff
path: root/rss.template
blob: 5662a0dfe01cfa1f4e56a22e9adfc1dc0eb9e076 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Twitter</title>
<link>https://twitter.com</link>
<description>Twitter</description>

{{range $index, $post := .}}
<item>
<title>{{$post.User.Screen_name}} ({{$post.Id_str}})</title>
<content:encoded><![CDATA[
{{$status := $post}} 
{{if $status.Retweeted_status}}
{{$status = $post.Retweeted_status}}
@{{$post.User.Screen_name}} ({{$post.Id_str}}) retweeted 
{{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>"}}
{{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
@{{$quotedUser}} ({{$status.Quoted_status.Id_str}}): <br><br>{{$status.Quoted_status.Text}}
{{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>