示例#1
0
def slideshow_tag(tag):
    url = _ensure_api()
    if url: return flask.redirect(url)

    title = quorum.conf("TITLE", "Instashow")
    sub_title = quorum.conf("SUB_TITLE", "Instagram + steroids")
    image = quorum.conf("IMAGE", None)
    timeout = quorum.get_field("timeout", 10000, cast = int)
    title = quorum.get_field("title", title)
    sub_title = quorum.get_field("sub_title", sub_title)
    image = quorum.get_field("image", image)

    api = _get_api()
    media = api.media_tag(tag)

    return flask.render_template(
        "tags/slideshow.html.tpl",
        link = "tags",
        sub_link = "slideshow",
        tag = tag,
        media = media,
        title = title,
        sub_title = sub_title,
        image = image,
        timeout = timeout
    )
示例#2
0
def oauth():
    code = quorum.get_field("code")
    state = quorum.get_field("state")

    api = _get_api()
    access_token = api.oauth_access(code)
    flask.session["ig.access_token"] = access_token
    flask.session["ig.user_id"] = api.user_id
    flask.session.permanent = True

    util.set_value("ig.access_token", access_token)

    return flask.redirect(state or flask.url_for("index"))
示例#3
0
def oauth():
    code = quorum.get_field("code")
    state = quorum.get_field("state")

    api = _get_api()
    access_token = api.oauth_access(code)
    flask.session["ig.access_token"] = access_token
    flask.session["ig.user_id"] = api.user_id
    flask.session.permanent = True

    util.set_value("ig.access_token", access_token)

    return flask.redirect(
        state or flask.url_for("index")
    )
示例#4
0
def schedule_tag(tag):
    url = _ensure_api()
    if url: return flask.redirect(url)

    quota = quorum.get_field("quota", util.QUOTA_USER, int)

    util.schedule_tag(tag, quota=quota)

    return flask.redirect(flask.url_for("show_tag", tag=tag))
示例#5
0
def schedule_tag(tag):
    url = _ensure_api()
    if url: return flask.redirect(url)

    quota = quorum.get_field("quota", util.QUOTA_USER, int)

    util.schedule_tag(tag, quota = quota)

    return flask.redirect(
        flask.url_for("show_tag", tag = tag)
    )
示例#6
0
def slideshow_tag(tag):
    url = _ensure_api()
    if url: return flask.redirect(url)

    title = quorum.conf("TITLE", "Instashow")
    sub_title = quorum.conf("SUB_TITLE", "Instagram + steroids")
    image = quorum.conf("IMAGE", None)
    timeout = quorum.get_field("timeout", 10000, cast=int)
    title = quorum.get_field("title", title)
    sub_title = quorum.get_field("sub_title", sub_title)
    image = quorum.get_field("image", image)

    api = _get_api()
    media = api.media_tag(tag)

    return flask.render_template("tags/slideshow.html.tpl",
                                 link="tags",
                                 sub_link="slideshow",
                                 tag=tag,
                                 media=media,
                                 title=title,
                                 sub_title=sub_title,
                                 image=image,
                                 timeout=timeout)