forked from git-ankit/MovieRecommender
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
061d42d
commit 9c7a428
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,26 @@ def beautify_feedback_data(data): | |
""" | ||
Utility function to beautify the feedback json containing predicted movies for sending in email | ||
""" | ||
pass | ||
# Create empty lists for each category | ||
yet_to_watch = [] | ||
like = [] | ||
dislike = [] | ||
|
||
# Iterate through the data and categorize movies | ||
for movie, status in data.items(): | ||
if status == 'Yet to watch': | ||
yet_to_watch.append(movie) | ||
elif status == 'Like': | ||
like.append(movie) | ||
elif status == 'Dislike': | ||
dislike.append(movie) | ||
|
||
# Create a plain text string for the categorized data | ||
categorized_data_str = "Movies Yet to Watch:\n" + "\n".join(yet_to_watch) + "\n\n" | ||
categorized_data_str += "Movies Liked:\n" + "\n".join(like) + "\n\n" | ||
categorized_data_str += "Movies Disliked:\n" + "\n".join(dislike) | ||
|
||
return categorized_data_str | ||
|
||
def send_email_to_user(recipient_email, message_body): | ||
""" | ||
|
@@ -21,7 +40,7 @@ def send_email_to_user(recipient_email, message_body): | |
sender_email = '[email protected]' | ||
|
||
# Use an app password since 2-factor authentication is enabled | ||
sender_password = '' | ||
sender_password = 'uxnd shis sazo mstj' | ||
subject = 'Your movie recommendation from PopcornPicks' | ||
|
||
# Create the email message | ||
|