From 772ffceb768c22fc908cbb7f3d065dbafbb6d4cd Mon Sep 17 00:00:00 2001 From: gdetrez Date: Fri, 1 Jun 2007 12:28:16 +0200 Subject: [PATCH] =?UTF-8?q?macro=20pour=20ins=C3=A9rer=20des=20videos=20yo?= =?UTF-8?q?utube?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit darcs-hash:20070601102816-f46e9-05355d09ad56e364fb34d0a1bfce39ae6901440c.gz --- wiki/macro/YouTube.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 wiki/macro/YouTube.py diff --git a/wiki/macro/YouTube.py b/wiki/macro/YouTube.py new file mode 100644 index 00000000..2858941e --- /dev/null +++ b/wiki/macro/YouTube.py @@ -0,0 +1,27 @@ +# -*- coding: iso-8859-1 -*- +""" + MoinMoin - YouTube Macro + Jesus L. Alvaro 2006 + v 0.0.2 + You can include YouTube videos in the wiki by using this macro: + [[YouTube(V8tSRJ8e3b0)]] or + [[YouTube(http://www.youtube.com/v/V8tSRJ8e3b0)]] + visit "http://www.iesvaldebernardo.es/w/Post/2006-11-30-1447/YouTube_en_la_Wiki." + +""" + +def execute(macro, text): + if text.find('http://')> -1: + try: + text = text.split('v=')[1] + except: + return u"URL non valide..." + url = 'http://www.youtube.com/v/%s' % text + html = u''' + + + + + + ''' % {"youtubelink": url} + return html