def user_pics(uname):
    result = ""
    result = storage.getHash(uname)
    clientstuff = storage.getInstaInfo(uname)
    client_id = clientstuff[0]
    client_token = clientstuff[1]
    pics = get_pics(client_id, client_token, result[1:])
    return pics
Example #2
0
def search():
    uname = request.args.get('uname')
    storage.addTweets(uname)
    if request.method == 'GET':
        try:
            storage.getInstaInfo(uname)
            pics = instagramhub.user_pics(uname)
            tweets = storage.getTweets(uname)
            photo = tweets[1]
            print storage.getTweets(uname)
            return render_template("instagram.html", tweets = tweets, images = pics, photo = photo)
        except:
            tweets = storage.getTweets(uname)
            print tweets
            queries='?'+'uname='+uname
            api = client.InstagramAPI(client_id='2e1ab1ca522343a589a4dc84eb31af41',
                                      client_secret='67b832ed8a9b4e67b8696a3db0a69fd2',
                                      redirect_uri='http://ml7.stuycs.org:6379/instagram'+ queries)
            return redirect(api.get_authorize_url(scope=['basic']))