if re.match(mail_re, link, re.I):
return 'mailto:' + link
elif re.match(url_re, link, re.I):
- return 'http://' + link
+ return 'https://' + link
return None
# find out our URL, needed for syndication
try:
n = os.environ['SERVER_NAME']
- p = os.environ['SERVER_PORT']
+ # Removed port because it messes up when behind a proxy
+ #p = os.environ['SERVER_PORT']
s = os.environ['SCRIPT_NAME']
- if p == '80': p = ''
- else: p = ':' + p
- full_url = 'http://%s%s%s' % (n, p, s)
+ #if p == '80': p = ''
+ #else: p = ':' + p
+ full_url = 'https://%s%s' % (n, s)
except KeyError:
full_url = 'Not needed'
import re
rst = re.sub(r'.. youtube:: (.*)', r'''.. raw:: html
- <div style="text-align: center; margin-bottom: 8pt">
- <object width="500" height="375">
- <param name="movie"
- value="http://www.youtube.com/v/\1&hl=en&fs=1"
- ></param>
- <param name="allowFullScreen" value="true"></param>
- <param name="allowscriptaccess" value="always"></param>
- <embed src="http://www.youtube.com/v/\1&hl=en&fs=1"
- type="application/x-shockwave-flash" allowscriptaccess="always"
- allowfullscreen="true" width="500" height="375"></embed>
- </object>
- </div>''', rst)
+ <iframe width="560" height="315"
+ src="https://www.youtube.com/embed/\1"
+ frameborder="0" allowfullscreen></iframe>
+ ''', rst)
rst = re.sub(r'.. vimeo:: (\w*)', r'''.. raw:: html
- <div style="text-align: center; margin-bottom: 8pt">
- <object width="500" height="375">
- <param name="allowfullscreen" value="true" />
- <param name="allowscriptaccess" value="always" />
- <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=\1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1" />
- <embed src="http://vimeo.com/moogaloop.swf?clip_id=\1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1"
- type="application/x-shockwave-flash"
- allowfullscreen="true"
- allowscriptaccess="always"
- width="500"
- height="375">
- </embed>
- </object>
- </div>''', rst)
+ <iframe src="https://player.vimeo.com/video/\1"
+ width="500" height="281" frameborder="0"
+ webkitallowfullscreen mozallowfullscreen
+ allowfullscreen></iframe>
+ ''', rst)
rst = re.sub(r'.. grooveshark:: (\w*)', r'''.. raw:: html
- <div class="grooveshark">
- <object width="220" height="300">
- <param name="movie"
- value="http://listen.grooveshark.com/widget.swf" />
- <param name="wmode" value="window" />
- <param name="allowScriptAccess" value="always" />
- <param name="flashvars"
- value="hostname=cowbell.grooveshark.com&playlistID=\1&style=metal&p=0" />
- <embed src="http://listen.grooveshark.com/widget.swf"
- type="application/x-shockwave-flash"
- width="220" height="300"
- flashvars="hostname=cowbell.grooveshark.com&playlistID=\1&style=metal&p=0"
- allowScriptAccess="always" wmode="window" />
- </object>
- </div>''', rst)
+ Grooveshark is no more! This was supposed to show \1.
+ ''', rst)
return rst_to_html(rst)
def to_vars(self):