Recursion isn't the problem. Not keeping track of seen tweets is the problem. Recursion can be used to detect cycles and traverse a cyclic graph in a way that doesn't blow up.
Edit: child comments are correct and I regret my oversight
1: https://www.researchgate.net/figure/A-diamond-shaped-DAG_fig...
Edit: is this an example? https://stackoverflow.com/a/1757915