<commit_before>module Social
	module Posts
		class Tweet < ActiveRecord::Base
			
			attr_accessible :tweet_id, :tweet
			
			validates :tweet_id, presence: true
			validates :tweet, presence: true
			
			include Social::Posts::Create
			
			def self.network
				"Twitter"
			end
			
			def self.import
				if Social::Engine.config.twitter_enabled
					tweets = Twitter.user_timeline Social::Engine.config.twitter_username
					tweets.each do |tweet|
						self.find_or_create_by_tweet_id(tweet.id) { |p| p.tweet = tweet.text; p.published_at = tweet.created_at }
					end
				else
					return false
				end
			end

		end
	end
end
<commit_msg>app authentication required by Twitter<commit_after>module Social
	module Posts
		class Tweet < ActiveRecord::Base
			
			attr_accessible :tweet_id, :tweet
			
			validates :tweet_id, presence: true
			validates :tweet, presence: true
			
			include Social::Posts::Create
			
			def self.network
				"Twitter"
			end
			
			def self.import
				if Social::Engine.config.twitter_enabled
					client = Twitter::Client.new consumer_key: Social::Engine.config.twitter_consumer_key, consumer_secret: Social::Engine.config.twitter_consumer_secret
					tweets = client.user_timeline Social::Engine.config.twitter_username
					tweets.each do |tweet|
						self.find_or_create_by_tweet_id(tweet.id) { |p| p.tweet = tweet.text; p.published_at = tweet.created_at }
					end
				else
					return false
				end
			end

		end
	end
end

{'fraction_non_alphanumeric': 0.07997265892002735, 'fraction_numerical': 0.0, 'mean_word_length': 3.23121387283237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2864214', 'n_tokens_mistral': 621, 'n_tokens_neox': 468, 'n_words': 108}