old_contents: from configuration import *
  from bot import Bot
  import logging
  import time
  import random
  
  def run_iteration(b, cfg, iteration):
  
      if cfg.follow_back_step > 0 and iteration % cfg.follow_back_step == 0:
          try:
              b.follow_back()
          except Exception, e:
              l.critical(e)
  
      if cfg.retweet_from_trends > 0 and iteration % cfg.retweet_from_trends == 0:
          try:
              b.retweet_from_trends(638242)  # Germany
          except Exception, e:
              l.critical(e)
  
      if cfg.reddit_search_and_pick > 0 and iteration % cfg.reddit_search_and_pick == 0:
          try:
              b.tweet_rand_reddit(cfg.reddit_subreddit, cfg.reddit_query)
          except Exception, e:
              l.critical(e)
  
  
  def main():
      cfg = Settings('settings_private.cfg').get_config()
      b = Bot(cfg)
      b.authenticate()
  
      iteration = 0
      while True:
          logging.debug('\n\nStarting %s iteration\n', iteration)
  
          run_iteration(b, cfg, iteration)
  
          wait_time = random.randint(cfg.cycle_wait_time * 0.8,
                                     cfg.cycle_wait_time)
  
          logging.debug('waiting %s seconds...', wait_time)
          time.sleep(wait_time)
          iteration += 1
  
  
  if  __name__ =='__main__':main()
new_contents: from configuration import *
  from bot import Bot
  import logging
  import time
  import random
  
  def run_iteration(b, cfg, iteration):
  
      if cfg.follow_back_step > 0 and iteration % cfg.follow_back_step == 0:
          try:
              b.follow_back()
          except Exception, e:
              l.critical(e)
  
      if cfg.retweet_from_trends > 0 and iteration % cfg.retweet_from_trends == 0:
          try:
              b.retweet_from_trends(638242)  # Germany
          except Exception, e:
              l.critical(e)
  
      if cfg.reddit_search_and_pick > 0 and iteration % cfg.reddit_search_and_pick == 0:
          try:
              b.tweet_rand_reddit(cfg.reddit_subreddit, cfg.reddit_query)
          except Exception, e:
              l.critical(e)
  
  
  def main():
      cfg = Settings('settings_private.cfg').get_config()
      b = Bot(cfg)
      b.authenticate()
  
      iteration = 0
      while True:
          logging.debug('\n\nStarting %s iteration\n', iteration)
  
          run_iteration(b, cfg, iteration)
  
          wait_time = random.randint(cfg.cycle_wait_time * 0.8,
                                     cfg.cycle_wait_time)
  
          logging.debug('waiting %s seconds...', wait_time)
          time.sleep(wait_time)
          iteration += 1
  
  
  if  __name__ == '__main__':
      main()
subject: fix division of cycles