We're going to use IFTTT to grab posts on reddit, send them to a fake a Wordpress application (ifttt), then to an external application to play with (reddit_to_twitter).
Below is an example of taking new posts from r/ruby
and posting them to your Twitter account.
- Sign up for IFTTT/Twitter/Reddit. You can use your personal accounts if you want.
- Register a new app to Twitter
- https://apps.twitter.com/
- Create New App
- Name:
whatever you want
- Description:
whatever you want
- Website:
http://google.com/
(will change in step 3) - Callback URL:
leave blank
- Name:
- Save application
- Select application
- Click on Permissons tab and change to
Read and Write
- Click on the Keys and Access Tokens tab. Generate an
Access Token
- Copy your generated keys for below
- Click on Permissons tab and change to
- Install Git/Git for Windows and Heroku Toolbelt
- Clone down the repos:
git clone https://github.com/enova/ifttt
git clone https://github.com/enova/reddit_to_twitter
- Configure reddit_to_twitter app and deploy to Heroku
cd reddit_to_twitter
- Change server.rb with your Twitter secret keys from above
git add .
git commit -m 'added keys'
heroku create YOURNAME-ruby
(replace YOURNAME with... your name)git push heroku master
- Update the Website setting on the Twitter app you created (step 2) with
YOURNAME-ruby.herokuapp.com
- Configure ifttt app and deploy to Heroku
- Edit app.js and change
var heroku_app
with your heroku URL for the reddit_to_twitter application (i.eYOURNAME-ruby.herokuapp.com
) git add .
git commit -m 'added heroku url'
heroku create YOURNAME-node
(replace YOURNAME with... your name)git push heroku master
- Add IFTTT.com channels
- When logged in, go to
Channels
- Select
WordPress
- Blog URL:
heroku URL for ifttt application
(i.eYOURNAME-node.herokuapp.com
) - Username:
first name
- Password:
anything
- Blog URL:
- Activate
- Go back to
Channels
- Select
Reddit
- Activate
- Login with Reddit
- Create a new IFTTT Recipe
- Go to
My Recipes
- Click
Create a Recipe
- Click
This
- Select
Reddit
as Trigger ChannelAny new post in a subreddit
as a Triggerruby
or any subreddit you want
- Select
- Click
That
- Select
WordPress
as Action ChannelCreate a post
as Action- Title:
whatever you want
(this is what you will tweet) - Body:
whatever you want
- Title:
- Create Recipe
- Select
- Manually Trigger the Recipe
- Press
Check
in your My Recipes Page of IFTTT - Check the log to see if it ran successfully
- Annoy your followers with automatically posted tweets.
You've finished the above steps, yet you're still not seeing any tweets?
- Use the command
heroku logs
inside of your app folders. This will show you the server log from your heroku apps.- In the
ifttt
app log, if you aren't seeing any lines that say POST, it's likely that your IFTTT Wordpress Trigger isn't pointing to the right app. Ensure it's pointing to your name app (YOURNAME-node.herokuapp.com) - In the
reddit_to_twitter
app log, if you aren't seeing any lines that say POST check yourifttt
app and ensure the heroku_url is set to your ruby app (YOURNAME-ruby.herokuapp.com).
- In the