00001
00002 """
00003 MoinMoin - YouTube macro Version 0.1
00004 Displays an emended object with the wanted video
00005
00006 <<YouTube(YouTubeID)>>
00007 Exampel: <<YouTube(2SXKM-dLJV8)>>
00008
00009 @copyright: 2008 by MarcelHäfner (www.heavy.ch)
00010 @license: GNU GPL, see COPYING for details.
00011
00012 """
00013
00014 import re, StringIO
00015 from MoinMoin import wikiutil
00016 _sysmsg = '<p><strong class="%s">%s</strong></p>'
00017
00018 def execute(macro, args):
00019 if not args:
00020 return (_sysmsg % ('error', 'Missing You!',))
00021
00022 params = args.split(",")
00023
00024 link = "%s" % (wikiutil.escape(params[0]),)
00025 width = params[1]
00026 height = params[2]
00027
00028
00029
00030 html= '''<a href="http://photos.willowgarage.com/photos/show/%(link)s"><img src="http://photos.willowgarage.com/photos/file/%(link)s?sz=%(width)s,%(height)s" width=%(width)s height=%(height)s style="display:block;"></a>''' % locals()
00031
00032 return macro.formatter.rawHTML(html)
00033