~ubuntu-branches/ubuntu/utopic/tdiary/utopic

« back to all changes in this revision

Viewing changes to contrib2/plugin/zh/nicovideo.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# ja/nicovideo.rb - Japanese resource
 
3
#
 
4
# Copyright (C) TADA Tadashi <sho@spc.gr.jp>
 
5
# Distributed under GPL.
 
6
#
 
7
 
 
8
def nicovideo_player_path
 
9
        'http://www.nicovideo.jp'
 
10
end
 
11
 
 
12
def nicovideo_feed( i )
 
13
        <<-HTML
 
14
                <table border="0" cellpadding="4" cellspacing="0" summary="#{h i[:title]}"><tr valign="top">
 
15
                <td><a href="#{i[:url]}"><img alt="#{h i[:title]}" src="#{i[:thumb]}" width="130" height="100" style="border:solid 1px #333;"></a></td>
 
16
                <td width="100%"><a href="#{i[:url]}"><strong>#{h i[:title]}</strong></a> (#{i[:length]})</td>
 
17
                </tr></table>
 
18
        HTML
 
19
end
 
20
 
 
21
def nicovideo_html( i )
 
22
        <<-HTML
 
23
                <table border="0" cellpadding="4" cellspacing="0" summary="#{h i[:title]}" style="margin-left:0em;">
 
24
                <tr valign="top">
 
25
                <td style="font-size:70%;border-width:0px;">
 
26
                <div style="margin:4px 0px;"><a href="#{i[:url]}" target="_blank"><img alt="#{h i[:title]}" src="#{i[:thumb]}" width="130" height="100" style="border:solid 1px #333;"></a></div>
 
27
                </td>
 
28
                <td width="100%" style="font-size:80%;border-width:0px;">
 
29
                <p><a href="#{i[:url]}" target="_blank" class="video"><strong>#{h i[:title]}</strong></a> (#{i[:length].split(/:/).map{|j|'%02d' % j.to_i}.join(':')})</p>
 
30
                <p><strong>#{i[:date][0,10]}</strong> Posted<br>
 
31
                <strong>#{i[:view].scan(/\d+?(?=\d{3}*$)/).join(",")}</strong> Views<br>
 
32
                <strong>#{i[:comment_num].scan(/\d+?(?=\d{3}*$)/).join(",")}</strong> Comments<br>
 
33
                <strong>#{i[:mylist].scan(/\d+?(?=\d{3}*$)/).join(",")}</strong> Mylists</p>
 
34
                </td>
 
35
                </tr>
 
36
                </table>
 
37
        HTML
 
38
end