Skip to content

Commit b56ee34

Browse files
committed
add aws to instagram feed workflow
1 parent 5e5fca9 commit b56ee34

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

backend/scraping/instagram_feed.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def process_recent_feed(cutoff=datetime.now(timezone.utc) - timedelta(days=2), m
194194
raw_image_url = get_post_image_url(post)
195195
if raw_image_url:
196196
image_url = s3_uploader.upload_image(raw_image_url)
197+
print(f"Uploaded image to S3: {image_url}")
197198
else:
198199
logger.warning(f"No image URL found for post {post.shortcode}, skipping image upload")
199200
image_url = None

backend/scraping/s3_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def upload_image(self, image_url, filename=None):
9191

9292
filename = f"events/{uuid.uuid4()}.{file_ext}"
9393

94+
print(f"Uploading image to S3: {filename}")
9495
self.s3_client.put_object(
9596
Bucket=self.bucket_name,
9697
Key=filename,
@@ -99,7 +100,8 @@ def upload_image(self, image_url, filename=None):
99100
CacheControl='max-age=31536000',
100101
ACL='public-read' # Make the object publicly accessible
101102
)
102-
103+
print(f"Image uploaded to S3: {filename}")
104+
103105
# Generate permanent public URL instead of presigned URL
104106
public_url = f"https://{self.bucket_name}.s3.{self.region}.amazonaws.com/{filename}"
105107
logger.info(f"Successfully uploaded image: {filename}")

0 commit comments

Comments
 (0)