bonzanini / Book-SocialMediaMiningPython

Companion code for the book "Mastering Social Media Mining with Python"
546 stars 265 forks source link

How to filter tweets (status) by attributes? #11

Open mariana0 opened 6 years ago

mariana0 commented 6 years ago

Hello! I'm working on an academic project based on Twitter data collecting. Before generating the JSON with tweets from a chosen user, like in twitter_get_user_timeline.py I'd like to select only tweets created in a certain day. How do I do that?

  for status in page:
       if status.created_at like Mon Sep 10:
                f.write(json.dumps(status._json)+"\n")

Is that close? Thanks