コード例 #1
0
ファイル: vimeo.py プロジェクト: rhemmanur/mirosubs
def get_embed(url, shortmem={}, width=EMBED_WIDTH, height=EMBED_HEIGHT):
    get_dict = {
        'server': 'vimeo.com',
        'show_title': 1,
        'show_byline': 1,
        'show_portrait': 0,
        'color': '',
        'fullscreen': 1
    }

    get_dict['clip_id'] = VIMEO_REGEX.match(url).groupdict()['video_id']

    flash_url = 'http://vimeo.com/moogaloop.swf?' + urllib.urlencode(get_dict)

    object_children = (E.PARAM(name="allowfullscreen", value="true"),
                       E.PARAM(name="allowscriptaccess", value="always"),
                       E.PARAM(name="movie", value=flash_url),
                       EMBED(src=flash_url,
                             type="application/x-shockwave-flash",
                             allowfullscreen="true",
                             allowscriptaccess="always",
                             width=str(EMBED_WIDTH),
                             height=str(EMBED_HEIGHT)))
    main_object = E.OBJECT(width=str(EMBED_WIDTH),
                           height=str(EMBED_HEIGHT),
                           *object_children)

    return tostring(main_object)
コード例 #2
0
ファイル: insert.py プロジェクト: matsen/teaching
def tree(tree_name, width="970", height="620"):
    return E.APPLET(E.PARAM(name="config_file",
                            value=BASE_URL + 'src/aptx_configuration_file'),
                    E.PARAM(name="url_of_tree_to_load",
                            value=BASE_URL + tree_name),
                    archive="forester.jar",
                    code="org.forester.archaeopteryx.ArchaeopteryxE.class",
                    codebase=BASE_URL,
                    width=width,
                    height=height,
                    alt="applet broken")
コード例 #3
0
ファイル: youtube.py プロジェクト: oaleeapp/EguoWorld
def get_embed(url, shortmem=None, width=EMBED_WIDTH, height=EMBED_HEIGHT):
    video_id = cgi.parse_qs(urlparse.urlsplit(url)[3])['v'][0]

    flash_url = 'http://www.youtube.com/v/%s&hl=en&fs=1' % video_id

    object_children = (E.PARAM(name="movie", value=flash_url),
                       E.PARAM(name="allowFullScreen", value="true"),
                       E.PARAM(name="allowscriptaccess", value="always"),
                       EMBED(src=flash_url,
                             type="application/x-shockwave-flash",
                             allowfullscreen="true",
                             allowscriptaccess="always",
                             width=str(EMBED_WIDTH),
                             height=str(EMBED_HEIGHT)))
    main_object = E.OBJECT(width=str(EMBED_WIDTH),
                           height=str(EMBED_HEIGHT),
                           *object_children)

    return tostring(main_object)
コード例 #4
0
ファイル: fora.py プロジェクト: oaleeapp/EguoWorld
def get_embed(url, shortmem=None, EMBED_WIDTH=400, EMBED_HEIGHT=264):
    enclosure_url = scrape_flash_enclosure_url(url, shortmem)
    split_index = enclosure_url.find('?')
    flash_url = enclosure_url[:split_index]
    flashvars = enclosure_url[split_index+1:].replace(
        'cliptype=clip', 'cliptype=full')

    object_children = (
        E.PARAM(name="flashvars", value=flashvars),
        E.PARAM(name='movie', value=flash_url),
        E.PARAM(name="allowFullScreen", value="true"),
        E.PARAM(name="allowscriptaccess", value="always"),
        EMBED(src=flash_url,
              flashvars=flashvars,
              type="application/x-shockwave-flash",
              allowfullscreen="true",
              allowscriptaccess="always",
              width=str(EMBED_WIDTH), height=str(EMBED_HEIGHT)))
    main_object = E.OBJECT(
        width=str(EMBED_WIDTH), height=str(EMBED_HEIGHT), *object_children)

    return etree.tostring(main_object)