예제 #1
0
def read_status(sid):
	status = Status.query.filter_by(sid=sid).first()
	if status is None:
		status = Status(sid=sid)
		db.session.add(status)
		db.session.commit()
	res = wclient.get('statuses/show', id=sid)
	status.update(res)

	if res['retweeted_status']:
		retweeted_sid = res['retweeted_status']['idstr']
		retweeted = Status.query.filter_by(sid=retweeted_sid).first()
		if retweeted is None:
			retweeted = Status(sid=retweeted_sid)
			db.session.add(retweeted)
			db.session.commit()
		retweeted.update(res['retweeted_status'])
	return jsonify(res)
예제 #2
0
def read_status_list():
	status_list = wclient.get('statuses/mentions/ids')
	return jsonify(status_list)