예제 #1
0
def feed():
    q = 'fruits'
    wiki_data = search.scrape_wiki(q)
    youtube_data = search.youtube_api(q)
    reddit_data = search.reddit_api(q)
    #so_data = search.get_so_data(q)

    resp = jsonify(data={
       'wiki_data':wiki_data,
       'youtube_data':youtube_data,
       'reddit_data':reddit_data,
    })
    resp.status_code = 200
    return resp
예제 #2
0
def SearchApi():
    q = request.args.get('q') or 0

    if not q:
        resp = jsonify(data={"GET request param q not specified"})
        resp.status_code = 500
        return resp
        

    wiki_data = search.scrape_wiki(q)
    youtube_data = search.youtube_api(q)
    reddit_data = search.reddit_api(q)
    #so_data = search.get_so_data(q)

    resp = jsonify(data={
       'wiki_data':wiki_data,
       'youtube_data':youtube_data,
       'reddit_data':reddit_data,
    })
    resp.status_code = 200
    return resp