<commit_before>desc "This task is called by the Heroku scheduler add-on"
task :update_feed => :environment do
  Rails.application.eager_load!
  puts "Updating feed..."
  puts "*" * 80
  TweetService.get_tweets_by_hashtag ENV["HASHTAG"]
  # NewsFeed.update
  puts "done."
end<commit_msg>added rake task to clear half of db<commit_after>desc "This task can be called by the Heroku scheduler add-on"
namespace :db do
	task :clear_half_db => :environment do
	  t = Time.now
	  puts "Clearing 50% of old posts..."
	  old_posts = Post.order(time_of_post: :asc).first(Post.all.count/2)
	  old_posts.each(&:destroy)
	  puts "done in #{Time.now - t} seconds."
	end
end

{'fraction_non_alphanumeric': 0.11515151515151516, 'fraction_numerical': 0.007575757575757576, 'mean_word_length': 4.0458015267175576, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3794368', 'n_tokens_mistral': 242, 'n_tokens_neox': 236, 'n_words': 70}