mirror of
https://github.com/5vl/AutomatedCats.git
synced 2025-05-23 22:06:57 +00:00
Update README.md
This commit is contained in:
parent
c99843fd24
commit
48c5978581
13
README.md
13
README.md
@ -1,15 +1,16 @@
|
||||
# AutomatedCats
|
||||
|
||||
So,
|
||||
I automated this using PipeDream with a little bit of my own code.
|
||||
I automated this using PipeDream some of my own code.
|
||||
|
||||
I started off by creating a trigger that automatically runs the code every 5 minutes.
|
||||

|
||||
|
||||
After that, I used my own piece of code which is in [get_image.js](https://github.com/5vl/AutomatedCats/blob/main/get_image.js)
|
||||
After that, I created a method that refreshes my token every hour so it doesn't expire (which takes around 2 hours), and you can find it at [get_auth_token.js](https://github.com/5vl/AutomatedCats/blob/main/get_auth_token.js).
|
||||
|
||||
Then, I used the "upload_media" Twitter workflow on Pipedream with the below info set:
|
||||

|
||||
Then I used some Python because it was a lot easier to work with for this, it gets the cat image, saves it to a temp file which gets deleted later, uploads the image to Twitter and gets the media id from that, then it creates a new tweet with the image and some text! You can find that code here: [get_cat_and_post.py](https://github.com/5vl/AutomatedCats/blob/main/get_cat_and_post.py).
|
||||
|
||||
Lastly, I used the "twitter_create_tweet" workflow to actually post the image + a message!
|
||||

|
||||
I also needed consumer keys, so I created a quick [get_consumer_keys.py](https://github.com/5vl/AutomatedCats/blob/main/get_consumer_keys.py) for that. It's not great, but does the job.
|
||||
After you do that you can paste in the keys in the other python file and it should work!
|
||||
|
||||
Happy catting!
|
||||
|
Loading…
x
Reference in New Issue
Block a user