Changeset 14647 for platform/tdiary/plugin
- Timestamp:
- 06/26/08 22:07:46 (5 months ago)
- Files:
-
- 1 modified
-
platform/tdiary/plugin/nicovideo.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/tdiary/plugin/nicovideo.rb
r11024 r14647 8 8 # Link to the movie and show thumbnail , description...: 9 9 # <%= nicovideo 'sm99999999' %> 10 # 11 # Link to the movie with original label: 12 # <%= nicovideo 'sm99999999', 'movie title' %> 13 # 14 # Link to the movie with original label and link: 15 # <%= nicovideo 'sm99999999', 'movie title', 'http://example.com/video' %> 10 16 # 11 17 # Show Inline player: … … 33 39 end 34 40 35 def nicovideo_inline( elem )36 url = elem.to_a( 'watch_url' )[0].text41 def nicovideo_inline( elem, label = nil, link = nil ) 42 url = link || elem.to_a( 'watch_url' )[0].text 37 43 thumb = elem.to_a( 'thumbnail_url' )[0].text 38 title = elem.to_a( 'title' )[0].text39 desc = elem.to_a( 'description' )[0].text40 comment = elem.to_a( 'last_res_body' )[0].text44 title = label || elem.to_a( 'title' )[0].text 45 desc = label ? nil : elem.to_a( 'description' )[0].text 46 comment = label ? nil : elem.to_a( 'last_res_body' )[0].text 41 47 length = elem.to_a( 'length' )[0].text 42 48 view = elem.to_a( 'view_counter' )[0].text … … 48 54 end 49 55 50 if feed? then56 if feed? or label then 51 57 result = <<-HTML 52 58 <table border="0" cellpadding="4" cellspacing="0" summary="#{title}"><tr valign="top"> … … 83 89 end 84 90 85 def nicovideo( video_id, label = nil )91 def nicovideo( video_id, label = nil, link = nil ) 86 92 begin 87 @conf.to_native( nicovideo_inline( nicovideo_call_api( video_id ).elements ), 'UTF-8' )93 @conf.to_native( nicovideo_inline( nicovideo_call_api( video_id ).elements, label, link ), 'UTF-8' ) 88 94 rescue ::Errno::ENOENT 89 95 "<strong>Sorry, #{video_id} was deleted.</strong>" 90 rescue Timeout::Error, OpenURI::HTTPError,SecurityError96 rescue Timeout::Error, OpenURI::HTTPError, SecurityError 91 97 nicovideo_iframe( video_id ) 92 98 end
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)