Attachment 'YouTube-0.0.2.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - YouTube Macro
   4     Jesus L. Alvaro 2006
   5     v 0.0.2
   6     You can include YouTube videos in the wiki by using this macro:
   7         [[YouTube(V8tSRJ8e3b0)]]  or
   8         [[YouTube(http://www.youtube.com/v/V8tSRJ8e3b0)]]
   9     visit "http://www.iesvaldebernardo.es/w/Post/2006-11-30-1447/YouTube_en_la_Wiki."
  10 
  11 """
  12 
  13 def execute(macro, text):
  14     if text.find('http://')> -1:
  15         url = text
  16     else:
  17         url = 'http://www.youtube.com/v/%s' % text
  18     html = '''
  19     <object width="425" height="350">
  20     <param name="movie" value="%(youtubelink)s"></param>
  21     <param name="wmode" value="transparent"></param>
  22     <embed src="%(youtubelink)s" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
  23     ''' % {"youtubelink": url}
  24     return html

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-11-30 17:28:46, 0.8 KB) [[attachment:YouTube-0.0.2.py]]
  • [get | view] (2009-10-18 15:05:59, 5.2 KB) [[attachment:YouTube-0.4.py]]
  • [get | view] (2010-05-19 21:23:36, 5.5 KB) [[attachment:YouTube-0.5.py]]
  • [get | view] (2011-01-29 10:49:40, 5.6 KB) [[attachment:YouTube-0.6.py]]
  • [get | view] (2009-10-18 15:06:13, 175.1 KB) [[attachment:youtube_singlevideo.png]]
  • [get | view] (2009-10-18 15:18:09, 299.2 KB) [[attachment:youtube_videobar.png]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.