Skip to content

Latest commit

 

History

History
91 lines (74 loc) · 4.13 KB

README.md

File metadata and controls

91 lines (74 loc) · 4.13 KB

enova SOA hacknight

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.


reddit_to_twitter

  1. Sign up for IFTTT/Twitter/Reddit. You can use your personal accounts if you want.
  1. 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
  • 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
  1. Install Git/Git for Windows and Heroku Toolbelt
  1. Clone down the repos:
  • git clone https://github.com/enova/ifttt
  • git clone https://github.com/enova/reddit_to_twitter
  1. 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
  1. 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.e YOURNAME-ruby.herokuapp.com)
  • git add .
  • git commit -m 'added heroku url'
  • heroku create YOURNAME-node (replace YOURNAME with... your name)
  • git push heroku master
  1. Add IFTTT.com channels
  • When logged in, go to Channels
  • Select WordPress
    • Blog URL: heroku URL for ifttt application (i.e YOURNAME-node.herokuapp.com)
    • Username: first name
    • Password: anything
  • Activate
  • Go back to Channels
  • Select Reddit
  • Activate
  • Login with Reddit
  1. Create a new IFTTT Recipe
  • Go to My Recipes
  • Click Create a Recipe
  • Click This
    • Select Reddit as Trigger Channel
      • Any new post in a subreddit as a Trigger
      • ruby or any subreddit you want
  • Click That
    • Select WordPress as Action Channel
      • Create a post as Action
        • Title: whatever you want (this is what you will tweet)
        • Body: whatever you want
    • Create Recipe
  1. Manually Trigger the Recipe
  • Press Check in your My Recipes Page of IFTTT
  • Check the log to see if it ran successfully
  1. Annoy your followers with automatically posted tweets.

debugging

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 your ifttt app and ensure the heroku_url is set to your ruby app (YOURNAME-ruby.herokuapp.com).