def retweet(): wrapper = TwitterApiWrapper( app.config['TWITTER_CONSUMER_KEY'], app.config['TWITTER_CONSUMER_SECRET'], app.config['TWITTER_ACCESS_TOKEN'], app.config['TWITTER_ACCESS_TOKEN_SECRET']) id = request.args.get('id', '') if id: wrapper.retweet(id) return jsonify(result='ok')
def index(): if not g.user: return redirect('/login') wrapper = TwitterApiWrapper() tweets = [] if g.user is not None: resp = twitter.get('favorites.json') if resp.status == 200: tweets = wrapper.favorites(resp.data) return render_template('index.html', twits=tweets)