Fix socials timestamp #50
Reference in New Issue
Block a user
Delete Branch "fix-socials-timestamp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Address issues with social media API handling and update the Dockerfile for dependency management.
Adjust timestamp handling in social media posts for consistency.
Pull Request Overview
This PR standardizes timestamp handling across social media integrations by renaming the
timefield totimestampin theSocialPostandSocialCommentmodels. The changes also improve the X (Twitter) API wrapper implementation and update the Dockerfile to properly install Node.js dependencies.timetotimestampacross all social media models and testsReviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
timefield totimestampin SocialPost and SocialComment modelstimestamp_mstotimestamp_stimestampinstead oftimerettiwtavailability checktimestampfieldtimestampfield💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
These commands should be combined into a single RUN instruction to reduce Docker image layers and ensure proper cleanup. Additionally,
apt updateshould be run before installing nodejs to refresh the package list after adding the NodeSource repository.@@ -28,19 +29,20 @@ class XWrapper(SocialWrapper):Using
shell=Truein subprocess.run() creates a security vulnerability as it allows shell injection attacks. Since the command is constructed using f-strings with user-controlled data (self.api_keyanduser), malicious values could execute arbitrary commands. Use a list of arguments instead:subprocess.run(['rettiwt', '-k', self.api_key, 'tweet', 'search', str(limit), '-f', str(user)], capture_output=True)