Exemplo n.º 1
0
def yt_insights():
    """
    Fetch YouTube insights for input video ids and store in json.
    """
    video_ids = request.args.get('ids')
    print type(video_ids), "\n=-------------------------\n"
    r = youtube_get_insights(video_ids)
    r = flask.Response(r)
    r.headers["Access-Control-Allow-Origin"] = "*"
    return r
Exemplo n.º 2
0
def yt_insights():
    """
    Fetch YouTube insights for input video ids and store in json.
    """
    video_ids = request.args.get('ids')
    video_ids = json.loads(str(video_ids.split("=")[1]))
    ytvideoids = ",".join(video_ids[0]['video_ids'])
    r = youtube_get_insights(ytvideoids, video_ids[1]['brandname'])
    r = flask.Response(r)
    r.headers["Access-Control-Allow-Origin"] = "*"
    return r