fernandod1 / Instagram-to-discord

Monitor instagram user account and automatically post new images to discord channel via a webhook. Working 2022!
https://www.fernando.info
Other
127 stars 63 forks source link

Refactor code to use env variables and use time to run non stop #11

Closed AbhayAysola closed 3 years ago

AbhayAysola commented 3 years ago

I made three major changes to the code.

  1. Refactor variables like INSTAGRAM_USERNAME and WEBHOOK_URL to use environment variables instead of being hardcoded. This would make it easier to deploy in the cloud.
  2. I used the time library to make it so that the code runs every set interval. This can be configured using the TIME_INTERVAL environment variable. The interval defaults to 600 which is 10 minutes.
  3. I refactored the code to use an environment variable instead of a file to store the last image id. This can help when using AWS Lambda or similar platforms to deploy the code.

I hope you find these changes appropriate. Thanks for this wonderful program :D

fernandod1 commented 3 years ago

Thank you very much for collabotation, nice changes added to master branch :)

AbhayAysola commented 3 years ago

:)