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.You are not allowed to attach a file to this page.