Example #1
0
def postMsg():
  try:
    Auth = tweepyAuth()
    screen_name = Auth.postMsg()
    return render_template('postmsg.html', user=screen_name)
  except Exception, e:
    log.exception(e)
    return render_template('error.html', errormsg = 'postMsg: ' + str(e))
Example #2
0
def logout():
  try:
    Auth = tweepyAuth()
    Auth.logout()
    return redirect('/') 
  except Exception, e:
    log.exception(e)
    return render_template('error.html', errormsg = 'logout: ' + str(e))
Example #3
0
def login():
  try:
    Auth = tweepyAuth()
    url = Auth.login()
    return redirect(url)
  except Exception, e:
    log.exception(e)
    return render_template('error.html', errormsg = 'login: ' + str(e))
Example #4
0
def send():
  try:
    text = request.form['text']
    log.info(text)
    Auth = tweepyAuth()
    Auth.send(text)
    return redirect('/postMsg')
  except Exception, e:
    log.exception(e)
    return render_template('error.html', errormsg = 'send: ' + str(e))
Example #5
0
def loggedin():
  try:
    if 'denied' in request.url:
      log.error(u'You denied request to sign in')
      return redirect('/')
    Auth = tweepyAuth()
    Auth.loggedin()
    return redirect('/postMsg') 
  except Exception, e:
    log.exception(e)
    return render_template('error.html', errormsg = 'loggedin: ' + str(e))
Example #6
0
def readMsg():
  try:
    Auth = tweepyAuth()
    statuses,user = Auth.readMsg()
    posts = []
    for status in statuses:
      item = {'date': status.created_at, 'msg':status.text}
      posts.append(item)
    return render_template('readmsg.html', user = user, posts=posts) 
  except Exception, e:
    log.exception(e)
    return render_template('error.html', errormsg = 'readMsg: ' + str(e))