SaxyPandaBear / food-pics

Scheduled webhook that scrapes Reddit and posts to Discord
MIT License
0 stars 0 forks source link

Handle Reddit posts with a link to the image in the submission body #8

Open SaxyPandaBear opened 2 years ago

SaxyPandaBear commented 2 years ago

The webhook did not render https://www.reddit.com/r/FoodPorn/comments/rn0kk1/homemade_burger_with_fries_and_spicy_ketchup/ properly. This is simply because the post did not have an image URL, and instead put the link to Imgur in the submission text.

Don't need to be fancy. Just need to be able to find reddit/imgur links in the submission text if there isn't an image URL. This can be done easily by extending the functionality that already exists in https://github.com/SaxyPandaBear/my-webhooks/blob/main/food-pics/food_post.py#L83 for deriving the image URL from the submission.