Fixed get_tweeted function

* Fixed reversed time comparison
* Fixed imports