rtlog 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ twitter_id: yuanying
2
+
3
+ url_prefix: 'http://192.168.10.8/~yuanying/lifelog'
4
+ time_zone: Tokyo
5
+
6
+ target_dir: ~/Sites/lifelog
7
+ config_dir: ~/.lifelog/config
8
+ temp_dir: ~/.lifelog/temp
9
+
10
+ pages:
11
+ rss:
12
+ size: 7
13
+ template: rss.xml.erb
14
+ index:
15
+ size: 7
16
+ template: index.html.erb
17
+ month:
18
+ size: 7
19
+ template: month.html.erb
20
+ day:
21
+ template: day.html.erb
22
+
@@ -0,0 +1,21 @@
1
+ <% day = self %>
2
+ <ul class='navigation'>
3
+ <li class='title'><%=title%>のアーカイブ</li>
4
+ </ul>
5
+
6
+ <div id='d_<%=day.date.strftime('%Y%m%d')%>' class='day'>
7
+ <h2><a href='<%=day.url%>'><%= day.date.strftime('%Y年%m月%d日(%a)')%></a></h2>
8
+ <% day.tweets do |tweet| %>
9
+ <div class='tweet' id='t_<%= tweet.id %>'>
10
+ <p class='tw_text'><%= tweet.formatted_text %></p>
11
+ <% if tweet.medias.size > 0 %>
12
+ <div class='media'>
13
+ <% tweet.medias.each do |m|%>
14
+ <p><a href='<%=m.url%>'><img src='<%=m.local_url%>' width='150' height='150' alt='' /></a></p>
15
+ <% end %>
16
+ </div>
17
+ <% end %>
18
+ <div class='tw_posted'>posted at <a href='<%= "http://twitter.com/#{tweet.user['screen_name']}/status/#{tweet.id}"%>' class='time'><%= tweet.created_at.strftime('%H時%M分%S秒')%></a></div>
19
+ </div>
20
+ <% end %>
21
+ </div>
@@ -0,0 +1,19 @@
1
+
2
+ <% recent_day_pages(size).each do |day| %>
3
+ <div id='d_<%=day.date.strftime('%Y%m%d')%>' class='day'>
4
+ <h2><a href='<%=day.url%>'><%= day.date.strftime('%Y年%m月%d日(%a)')%></a></h2>
5
+ <% day.tweets do |tweet| %>
6
+ <div class='tweet' id='t_<%= tweet.id %>'>
7
+ <p class='tw_text'><%= tweet.formatted_text %></p>
8
+ <% if tweet.medias.size > 0 %>
9
+ <div class='media'>
10
+ <% tweet.medias.each do |m|%>
11
+ <p><a href='<%=m.url%>'><img src='<%=m.local_url%>' width='150' height='150' alt='' /></a></p>
12
+ <% end %>
13
+ </div>
14
+ <% end %>
15
+ <div class='tw_posted'>posted at <a href='<%= "http://twitter.com/#{tweet.user['screen_name']}/status/#{tweet.id}"%>' class='time'><%= tweet.created_at.strftime('%H時%M分%S秒')%></a></div>
16
+ </div>
17
+ <% end %>
18
+ </div>
19
+ <% end %>
@@ -0,0 +1,229 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <meta http-equiv="content-style-type" content="text/css" />
7
+ <meta http-equiv="content-script-type" content="text/javascript" />
8
+
9
+ <title><%=h title %> -- Lifelog @ <%=h config['twitter_id']%> from twitter.com</title>
10
+ <link rel="alternate" type="application/rss+xml" title="<%=h title %> -- Lifelog @ <%=config['twitter_id']%> from twitter.com" href="<%=Rtlog::RssPage.new(config, log).url%>" />
11
+ <style type="text/css">
12
+ * {
13
+ word-break: normal !important; word-wrap: break-word;
14
+ }
15
+ body {
16
+ text-align: center;
17
+ background-color:#<%=log.user.profile_background_color%>;
18
+ <% if log.user.profile_background_tile == false %>
19
+ background-repeat: no-repeat;
20
+ <% end %>
21
+ background-attachment: fixed;
22
+ background-position: left top;
23
+ background-image: url(<%=log.user.profile_background_image_url%>);
24
+ color: #<%=log.user.profile_text_color%>;
25
+ font-family: sans-serif;
26
+ }
27
+ img {
28
+ border: none;
29
+ }
30
+ a:link { text-decoration:none; color:#<%=log.user.profile_link_color%>;}
31
+ a:visited { text-decoration:none; color:#<%=log.user.profile_link_color%>;}
32
+ a:hover { text-decoration:underline; color:#<%=log.user.profile_link_color%>;}
33
+ .contents {
34
+ border-collapse: collapse;
35
+ margin: auto;
36
+ text-align: left;
37
+ margin-top: 64px;
38
+ }
39
+ #page {
40
+ border-top-left-radius: 5px; -webkit-border-top-left-radius: 5px; -moz-border-top-left-radius: 5px;
41
+ border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-bottom-left-radius: 5px;
42
+ background-color: #fff;
43
+ vertical-align: top;
44
+ width: 508px;
45
+ padding: 32px;
46
+ }
47
+ #page .profile h1 {
48
+ margin: 0;
49
+ position: relative;
50
+ }
51
+ #page .profile .profile_names {
52
+ position: absolute;
53
+ top: 0;
54
+ left: 80px;
55
+ }
56
+ #page .profile .screen_name {
57
+ font-size: medium;
58
+ }
59
+ #page .tw_posted {
60
+ font-size: 90%;
61
+ color: #ccc;
62
+ border-bottom: 1px solid #eee;
63
+ padding: 0.2em 0;
64
+ }
65
+ #page .tw_posted a {
66
+ color: #ccc;
67
+ }
68
+ #page .navigation {
69
+ margin: 0;
70
+ padding: 0;
71
+ }
72
+ #page .navigation li {
73
+ font-size: 90%;
74
+ display: inline;
75
+ }
76
+ #page .navigation .previous:before {
77
+ content: '« ';
78
+ }
79
+ #page .navigation .previous {
80
+ margin-right: 0.4em;
81
+ }
82
+ #page .navigation .next {
83
+ margin-left: 0.4em;
84
+ }
85
+ #page .navigation .next:after {
86
+ content: ' »';
87
+ }
88
+ #page .day {
89
+ padding: 1em 0;
90
+ }
91
+ #page .day h2 {
92
+ color: #ccc;
93
+ border: 1px solid #eee;
94
+ border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px;
95
+ background-color: #f6f6f6;
96
+ margin: 0;
97
+ padding: 0.3em;
98
+ }
99
+ #page .day h2 a {
100
+ color: #ccc;
101
+ }
102
+ #informations {
103
+ border-left: 1px solid #<%=log.user.profile_sidebar_border_color%>;
104
+ border-top-right-radius: 5px; -webkit-border-top-right-radius: 5px; -moz-border-top-right-radius: 5px;
105
+ border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-bottom-right-radius: 5px;
106
+ background-color: #<%=log.user.profile_sidebar_fill_color%>;
107
+ vertical-align: top;
108
+ width: 200px;
109
+ font-size: 90%;
110
+ }
111
+ #informations h2 {
112
+ border-bottom: 1px solid #<%=log.user.profile_sidebar_border_color%>;
113
+ }
114
+ #informations .info ul {
115
+ margin: 0;
116
+ padding: 0;
117
+ }
118
+ #informations .info li {
119
+ display: block;
120
+ margin: 0;
121
+ padding: 0 0 0 1em;
122
+ }
123
+ #informations .info {
124
+ padding: 10px;
125
+ }
126
+ #informations .profile dt {
127
+ font-weight: bold;
128
+ }
129
+ #informations .profile dd {
130
+ margin: 0;
131
+ padding: 0;
132
+ margin-left: 1em;
133
+ }
134
+ #publications {
135
+ text-align: center;
136
+ width: 711px;
137
+ padding: 8px 32px;
138
+ margin: auto;
139
+ margin-top: 1em;
140
+ background-color: #fff;
141
+ border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px;
142
+ }
143
+ #publications ul {
144
+ padding: 0;
145
+ margin: 0;
146
+ }
147
+ #publications li {
148
+ font-size: 90%;
149
+ display: inline;
150
+ }
151
+ #publications li:first-child:after {
152
+ content: ',';
153
+ }
154
+ </style>
155
+ </head>
156
+
157
+ <body>
158
+
159
+ <table class='contents'><tbody>
160
+ <tr>
161
+ <td id='page'>
162
+ <div class="profile">
163
+ <h1>
164
+ <a href='<%=index_url%>'>
165
+ <img src='<%=log.user.profile_image_url.gsub('_nomal', '_bigger')%>' width='73' height='73' alt='profile image' />
166
+ </a>
167
+ <span class='profile_names'>
168
+ <span class='name'><%=h log.user.name%></span>
169
+ <span class='screen_name'>
170
+ (<a href='http://twitter.com/<%=h log.user.screen_name%>'><%=h log.user.screen_name%></a>)
171
+ </span>
172
+ </span>
173
+ </h1>
174
+ </div>
175
+
176
+ <%= parse template_path %>
177
+ </td>
178
+
179
+ <td id='informations'>
180
+ <div class='info'>
181
+ <script type="text/javascript"><!--
182
+ google_ad_client = "pub-7301724253634317";
183
+ /* Rtlog */
184
+ google_ad_slot = "3573554836";
185
+ google_ad_width = 180;
186
+ google_ad_height = 150;
187
+ //-->
188
+ </script>
189
+ <script type="text/javascript"
190
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
191
+ </script>
192
+ </div>
193
+ <div class='info'>
194
+ <div class='section'>
195
+ <dl class='profile'>
196
+ <dt>名前</dt>
197
+ <dd><%=h log.user.name%></dd>
198
+ <dt>現在地</dt>
199
+ <dd><%=h log.user.location%></dd>
200
+ <dt>Web</dt>
201
+ <dd><a href='<%=log.user.url%>'><%=log.user.url[0, 16]%>...</a></dd>
202
+ <dt>自己紹介</dt>
203
+ <dd><%=h log.user.description%></dd>
204
+ </dl>
205
+ </div>
206
+ </div>
207
+ <div class='info'>
208
+ <h2>Archives</h2>
209
+ <div class='section'>
210
+ <ul>
211
+ <% month_pages.each do |month|%>
212
+ <li><a href='<%=month.url%>'><%=month.date.strftime('%Y年%m月')%>(<%=month.total_tweets%>)</a></li>
213
+ <% end %>
214
+ </ul>
215
+ </div>
216
+ </div>
217
+ </td>
218
+ </tr>
219
+ </tbody></table>
220
+
221
+ <div id="publications">
222
+ <ul>
223
+ <li>&copy; 2009-<%=Time.now.strftime('%Y')%> <%=h config['twitter_id']%></li>
224
+ <li>Generated by <a href='http://github.com/yuanying/rtlog'>Rtlog</a></li>
225
+ </ul>
226
+ </div>
227
+
228
+ </body>
229
+ </html>
@@ -0,0 +1,70 @@
1
+ <%
2
+ previous_page = previous
3
+ next_page = self.next
4
+ %>
5
+
6
+ <ul class='navigation'>
7
+ <% if previous_month_page %>
8
+ <li class='previous'><a href='<%=previous_month_page.url%>'><%=previous_month_page.title%></a></li>
9
+ <% end %>
10
+ <li class='title'><%=title%>のアーカイブ</li>
11
+ <% if next_month_page %>
12
+ <li class='next'><a href='<%=next_month_page.url%>'><%=next_month_page.title%></a></li>
13
+ <% end %>
14
+ </ul>
15
+
16
+ <% if previous_page || next_page %>
17
+ <ul class='navigation'>
18
+ <% if previous_page %>
19
+ <li class='previous'><a href='<%=previous_page.url%>'>Newer</a></li>
20
+ <% end %>
21
+ <% (1..total_pages).each do |i| %>
22
+ <% if i == current_page %>
23
+ <li class='current_page'><%=i%></li>
24
+ <% else %>
25
+ <li class='not_current_page'><a href='<%=url(i)%>'><%=i%></a></li>
26
+ <% end %>
27
+ <% end %>
28
+ <% if next_page %>
29
+ <li class='next'><a href='<%=next_page.url%>'>Older</a></li>
30
+ <% end %>
31
+ </ul>
32
+ <% end %>
33
+
34
+ <% current_day_pages.each do |day| %>
35
+ <div id='d_<%=day.date.strftime('%Y%m%d')%>' class='day'>
36
+ <h2><a href='<%=day.url%>'><%= day.date.strftime('%Y年%m月%d日(%a)')%></a></h2>
37
+ <% day.tweets do |tweet| %>
38
+ <div class='tweet' id='t_<%= tweet.id %>'>
39
+ <p class='tw_text'><%= tweet.formatted_text %></p>
40
+ <% if tweet.medias.size > 0 %>
41
+ <div class='media'>
42
+ <% tweet.medias.each do |m|%>
43
+ <p><a href='<%=m.url%>'><img src='<%=m.local_url%>' width='150' height='150' alt='' /></a></p>
44
+ <% end %>
45
+ </div>
46
+ <% end %>
47
+ <div class='tw_posted'>posted at <a href='<%= "http://twitter.com/#{tweet.user['screen_name']}/status/#{tweet.id}"%>' class='time'><%= tweet.created_at.strftime('%H時%M分%S秒')%></a></div>
48
+ </div>
49
+ <% end %>
50
+ </div>
51
+ <% end %>
52
+
53
+ <% if previous_page || next_page %>
54
+ <ul class='navigation'>
55
+ <% if previous_page %>
56
+ <li class='previous'><a href='<%=previous_page.url%>'>Newer</a></li>
57
+ <% end %>
58
+ <% (1..total_pages).each do |i| %>
59
+ <% if i == current_page %>
60
+ <li class='current_page'><%=i%></li>
61
+ <% else %>
62
+ <li class='not_current_page'><a href='<%=url(i)%>'><%=i%></a></li>
63
+ <% end %>
64
+ <% end %>
65
+ <% if next_page %>
66
+ <li class='next'><a href='<%=next_page.url%>'>Older</a></li>
67
+ <% end %>
68
+ </ul>
69
+ <% end %>
70
+
@@ -0,0 +1,50 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <rdf:RDF
3
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
4
+ xmlns="http://purl.org/rss/1.0/"
5
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
6
+ xmlns:admin="http://webns.net/mvcb/"
7
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
8
+ xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">
9
+ <channel rdf:about="<%= index_url %>">
10
+ <title>Lifelog @ <%=h config['twitter_id']%> from twitter.com</title>
11
+ <link><%= index_url %></link>
12
+ <description>Lifelog @ <%=h config['twitter_id']%> from twitter.com</description>
13
+ <%#<dc:language>${blog.locale.language}</dc:language>%>
14
+ <dc:creator><%=h log.user.name%></dc:creator>
15
+ <dc:date><%= Time.now.iso8601 %></dc:date>
16
+ <admin:generatorAgent rdf:resource="TwitLogger"/>
17
+ <items>
18
+ <rdf:Seq>
19
+ <% recent_day_pages(size).each do |day| %>
20
+ <rdf:li rdf:resource="<%= day.url %>" />
21
+ <% end %>
22
+ </rdf:Seq>
23
+ </items>
24
+ </channel>
25
+
26
+ <% recent_day_pages(size).each do |day| %>
27
+ <item rdf:about="<%= day.url %>">
28
+ <title><%=h day.title %></title>
29
+ <link><%= day.url %></link>
30
+ <description>Life log at <%=h day.title %></description>
31
+ <content:encoded><![CDATA[
32
+ <% day.tweets do |tweet| %>
33
+ <div class='tweet' id='t_<%= tweet.id %>'>
34
+ <p class='tw_text'><%= tweet.formatted_text %></p>
35
+ <% if tweet.medias.size > 0 %>
36
+ <div class='media'>
37
+ <% tweet.medias.each do |m|%>
38
+ <p><a href='<%=m.url%>'><img src='<%=m.local_url%>' width='150' height='150' alt='' /></a></p>
39
+ <% end %>
40
+ </div>
41
+ <% end %>
42
+ <div class='tw_posted'>posted at <a href='<%= "http://twitter.com/#{tweet.user['screen_name']}/status/#{tweet.id}"%>' class='time'><%= tweet.created_at.strftime('%H時%M分%S秒')%></a></div>
43
+ </div>
44
+ <% end %>
45
+ ]]></content:encoded>
46
+ <dc:creator><%=h log.user.name%></dc:creator>
47
+ <dc:date><%= day.date.iso8601 %></dc:date>
48
+ </item>
49
+ <% end %>
50
+ </rdf:RDF>
@@ -0,0 +1,82 @@
1
+ body {
2
+ text-align: center;
3
+ }
4
+
5
+ img {
6
+ border: none;
7
+ }
8
+
9
+ .contents {
10
+ margin: auto;
11
+ text-align: left;
12
+ }
13
+
14
+ #page {
15
+ vertical-align: top;
16
+ width: 524px;
17
+ padding: 1em;
18
+ }
19
+ #page .profile h1 {
20
+ margin: 0;
21
+ position: relative;
22
+ }
23
+ #page .profile .profile_names {
24
+ position: absolute;
25
+ top: 0;
26
+ left: 80px;
27
+ }
28
+ #page .profile .screen_name {
29
+ font-size: medium;
30
+ }
31
+ #page .tw_posted {
32
+ color: #ccc;
33
+ border-bottom: 1px dotted #ccc;
34
+ padding: 0.2em 0;
35
+ }
36
+ #page .navigation {
37
+ margin: 0;
38
+ padding: 0;
39
+ }
40
+ #page .navigation li {
41
+ font-size: 90%;
42
+ display: inline;
43
+ }
44
+ #page .navigation .previous:before {
45
+ content: '« ';
46
+ }
47
+ #page .navigation .previous {
48
+ margin-right: 0.4em;
49
+ }
50
+ #page .navigation .next {
51
+ margin-left: 0.4em;
52
+ }
53
+ #page .navigation .next:after {
54
+ content: ' »';
55
+ }
56
+
57
+ #informations {
58
+ vertical-align: top;
59
+ width: 200px;
60
+ font-size: 90%;
61
+ }
62
+ #informations .info ul {
63
+ margin: 0;
64
+ padding: 0;
65
+ }
66
+ #informations .info li {
67
+ display: block;
68
+ margin: 0;
69
+ padding: 0 0 0 1em;
70
+ }
71
+ #informations .info {
72
+ padding: 0.4em;
73
+ }
74
+ #informations .profile dt {
75
+ font-weight: bold;
76
+ }
77
+ #informations .profile dd {
78
+ margin: 0;
79
+ padding: 0;
80
+ margin-left: 1em;
81
+ }
82
+