title: Scraping tweets via Python for specific hours of the day
body: <p>I was wondering if someone could help me with modifying my current code for scraping tweets based on specific hours during each day. I'm currently using <a href="https://github.com/Jefferson-Henrique/GetOldTweets-python" rel="nofollow noreferrer">https://github.com/Jefferson-Henrique/GetOldTweets-python</a> to scrape tweets from more than 1 week ago. I downloaded all his files and pip installed all of the packages. I tried modifying to scrape tweets from 7:30-8:30pm(19:30-20:30) for each day from Nov 9th through Dec 7th and save those tweets in a csv. However, I cannot get it to scrape the tweets for me. This is how I modified the script:</p>
  <pre><code>import got
  import csv
  from unidecode import unidecode
  import datetime
  
  # Based on his docs, it looks like you need to do something like this
  tweetCriteria = got.manager.TweetCriteria().setQuerySearch('Google').setSince(&quot;2016-11-09&quot;).setUntil(&quot;2016-12-07&quot;)
  # All the tweets
  print &quot;Getting Tweets&quot;
  tweets = got.manager.TweetManager.getTweets(tweetCriteria)
  
  BeginHour = 19
  EndHour = 20
  Minutes = 30
  
  print &quot;\nWriting CSV File&quot;
  n_written = 0
  with open('tweets3.csv', 'w') as csvFile:
      TweetWriter = csv.writer(csvFile, delimiter=',')
      TweetWriter.writerow(['user','SentimentText','Date'])
  
      for tweet in tweets:
          if (tweet.date.hour &gt; BeginHour and tweet.date.minute &gt; Minutes) or \
         (tweet.date.hour &lt; EndHour and tweet.date.minute &lt; Minutes):
              user = unidecode(tweet.username)
              txt = unidecode(tweet.text)
              dt = tweet.date
  
              print &quot;\nAdding Tweet to CSV File&quot;
              TweetWriter.writerow([user, 0, txt, dt])
          
              n_written += 1
              print &quot;There are now {} tweets in the CSV&quot;.format(n_written)
  </code></pre>
  <p>I'd greatly appreciate any help</p>