Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add twitter setup. knock yourselves out. #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jneen
Copy link
Contributor

@jneen jneen commented Sep 17, 2013

Usage: Twitter.update('Ya bish')

config.consumer_key = 'asdVzxnbO5VVonQaZIWMUg'
config.consumer_secret = 'his1Q4Npqot5z6w8F5drIjyGI2fic1RH0SkCHcPgl0I'
config.oauth_token = '1732928202-8MZzFHuwxtYl7lIyDV3J2iOnn5cBMqp7J07P0LI'
config.oauth_token_secret = 'bxIgiFEnGp8ACvCGdDy9qseZUf7DGvKDCz2B29y5vc'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't put credentials in open source files, stupid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll regenerate them if you set it up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's your pull req. :| you fix it

@wesdotcool
Copy link
Contributor

Umm. What's going on with this PR now? There's no commits. Instead of putting the tokens directly in the code, you can pull it from the ENV variable.

@jneen
Copy link
Contributor Author

jneen commented Sep 18, 2013

And then anybody who wants to run steggybot has to directly message me to get the credentials and set 4 ENV variables?

@jneen
Copy link
Contributor Author

jneen commented Sep 18, 2013

New usage:

class MyPlugin
  include Tweetable

  def some_method
    tweet "ya bish"
  end
end

You have to put a config file in config/twitter.rb. There is an example and I'll post the credentials in irc.

# gem
require 'twitter'

module Tweetable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@wesdotcool
Copy link
Contributor

@jayferd well if they want to tweet to YOUR twitter account, they better damn well have to get the credentials from you. Alternatively, they can make their own credentials and use this to tweet to their own accounts. You'll just have to give steggy the creds so he can put them up on the production instance, and then everyone else can either not use this function if they're running it locally, use their own creds and twitter account, or pm you for your creds.

config.consumer_key = 'EXAMPLE'
config.consumer_secret = 'EXAMPLE'
config.oauth_token = 'EXAMPLE'
config.oauth_token_secret = 'EXAMPLE'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still like the idea of ENV variables because this means that you have to deal changing this file every time you pull, instead of adding some ENV variables once on every machine you run this one. But if you feel strongly that this is a better solution I'd like to hear you out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean "changing this file every time you pull"? The actual config/twitter.rb is not checked in, and I'm actually going to .gitignore it. This file actually doesn't do anything. And really, for dev work, you can just not set it up and it'll print "tweeting: thing" every time you try to tweet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I didn't realize that this was labeled as an example and the actual file is in the .gitignore. Could you place a comment at top of the file explaining the user should copy this file to config/twitter.rb and replace the keys with their keys? That will be helpful.

@cjzhang
Copy link
Contributor

cjzhang commented Sep 24, 2013

+1 let's merge this in at some point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants