-
-
Save axpence/b87122e50dc9b9e5379d18b01a4cb8f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| class ThbkCommentsGenerator: | |
| ''' | |
| creates comments B A B A Y | |
| ''' | |
| heart_eyes_emoji = u'\U0001F60D' | |
| raised_hands = u'\U0001F64C' | |
| thumbs_up = u'\U0001F44D' | |
| face_blowing_a_kiss = u'\U0001F618' | |
| red_heart = u'\U00002764' | |
| okay_hand = u'\U0001f44c' | |
| beating_heart = u'\U0001F493' | |
| emojis = [heart_eyes_emoji,heart_eyes_emoji,raised_hands,thumbs_up,face_blowing_a_kiss,red_heart,okay_hand,beating_heart] | |
| def random_emoji(self): | |
| return random.choice(self.emojis) | |
| def random_good_word(self): | |
| return random.choice(['great','amazing','cute','precious','adorable','gorgeous','sweet']) | |
| def random_number_of_emojis(self): | |
| num_emojis = random.choice([1,2,2,2,3,3,4]) | |
| s = u'' | |
| for x in range(0,num_emojis): | |
| s = s + self.random_emoji() + u'' | |
| return s | |
| def random_love_string(self): | |
| return random.choice([u'love',u'love',u'loove',u'looove',u'looooove',u'Love']) | |
| def generate_comments(self): | |
| cmts = [] | |
| for x in range(0,100000):#100k will generate on avg 393,479 unique comments!! | |
| cmts.append(self.random_number_of_emojis() + u' too ' + self.random_good_word() + '!') | |
| cmts.append(self.random_number_of_emojis() + u' too ' + self.random_good_word() + '!') | |
| cmts.append(self.random_good_word() + u'! ' + self.random_number_of_emojis()) | |
| cmts.append(u'so ' + self.random_good_word() + u' ' + self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis() + u' ' + self.random_good_word() + u' ' + self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis()) | |
| cmts.append(self.random_love_string() + u' ' + self.random_love_string() + u' it! ' + self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis() + u' '+ self.random_love_string() + u' it! ' + self.random_number_of_emojis()) | |
| cmts.append(self.random_love_string() + u' it! ' + self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis() + u'so ' + self.random_good_word() + self.random_number_of_emojis()) | |
| cmts.append(self.random_number_of_emojis() + u' ' + self.random_love_string() + u' it!') | |
| cmts.append(self.random_love_string() + u' it!' + self.random_number_of_emojis()) | |
| cmts.append(u'too ' + self.random_good_word() + self.random_number_of_emojis()) | |
| cmts.append(u'I ' + self.random_love_string() + u' this' + self.random_number_of_emojis()) | |
| cmts.append(self.random_love_string() + u' it!' + self.random_number_of_emojis() + u' so' + self.random_good_word() + u'!') | |
| cmts.append(self.random_love_string() + u' it!' + self.random_number_of_emojis() + u' ' + self.random_good_word() + u'!') | |
| print(str(len(cmts)) + ' total cmts generated') | |
| self.comments = set(cmts) | |
| print(str(len(self.comments)) + ' unique comments generated') | |
| def __init__(self): | |
| self.comments = [] | |
| random.seed() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| class ThbkCommentsGenerator: | |
| ''' | |
| creates comments B A B A Y | |
| ''' | |
| def __init__(self): | |
| self.comments = [] | |
| def generate_comments(self): | |
| heart_eyes_emoji = u'\U0001F60D' | |
| raised_hands = u'\U0001F64C' | |
| thumbs_up = u'\U0001F44D' | |
| face_blowing_a_kiss = u'\U0001F618' | |
| red_heart = u'\U00002764' | |
| okay_hand = u'\U0001f44c' | |
| beating_heart = u'\U0001F493' | |
| emojis = [heart_eyes_emoji,heart_eyes_emoji,raised_hands,thumbs_up,face_blowing_a_kiss,red_heart,okay_hand,beating_heart] | |
| def random_emoji(): | |
| return random.choice(emojis) | |
| def random_good_word(): | |
| return random.choice(['great','amazing','cute','precious','adorable','gorgeous','sweet']) | |
| def random_number_of_emojis(): | |
| num_emojis = random.choice([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,3]) | |
| seed_moj = random_emoji() | |
| s = u'' | |
| for x in range(0,num_emojis): | |
| s = s + seed_moj + u'' | |
| return s | |
| def random_love_string(): | |
| return random.choice([u'love',u'love',u'loove',u'looove',u'looooove',u'Love']) | |
| #TODO: how to call these functions EVERY TIME?! Should I create a shit long list of comments then? | |
| # otherwise comments are the same for each section! V. bad! | |
| comments = [] | |
| for x in range(0,100000):#100k will generate on avg 393,479 unique comments!! | |
| comments.append(random_number_of_emojis() + u' too ' + random_good_word() + '!') | |
| comments.append(random_number_of_emojis() + u' too ' + random_good_word() + '!') | |
| comments.append(random_good_word() + u'! ' + random_number_of_emojis()) | |
| comments.append(u'so ' + random_good_word() + u' ' + random_number_of_emojis()) | |
| comments.append(random_number_of_emojis() + u' ' + random_good_word() + u' ' + random_number_of_emojis()) | |
| comments.append(random_number_of_emojis()) | |
| comments.append(random_love_string() + u' ' + random_love_string() + u' it! ' + random_number_of_emojis()) | |
| comments.append(random_number_of_emojis() + u' '+ random_love_string() + u' it! ' + random_number_of_emojis()) | |
| comments.append(random_love_string() + u' it! ' + random_number_of_emojis()) | |
| comments.append(random_number_of_emojis() + u'so ' + random_good_word() + random_number_of_emojis()) | |
| comments.append(random_number_of_emojis() + u' ' + random_love_string() + u' it!') | |
| comments.append(random_love_string() + u' it!' + random_number_of_emojis()) | |
| comments.append(u'too ' + random_good_word() + random_number_of_emojis()) | |
| comments.append(u'I ' + random_love_string() + u' this' + random_number_of_emojis()) | |
| comments.append(random_love_string() + u' it!' + random_number_of_emojis() + u' so' + random_good_word() + u'!') | |
| comments.append(random_love_string() + u' it!' + random_number_of_emojis() + u' ' + random_good_word() + u'!') | |
| # print(comments) | |
| unique_comments = list(set(comments)) | |
| print(str(len(comments)) + ' total comments generated') | |
| print(str(len(unique_comments)) + ' total unique comments generated') | |
| print("first five comments:") | |
| for x in range(0,5): | |
| print unique_comments[x] | |
| print("...") | |
| return unique_comments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment