Stage 2 – the Python code to process tweets