merged twends-stream.py and twends.py