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

Auto post on Twitter when a new snippet is approved via admin dashboard #8

Open
johnnncodes opened this issue Dec 14, 2013 · 3 comments

Comments

@johnnncodes
Copy link
Owner

No description provided.

@johnnncodes
Copy link
Owner Author

Thanks for the link. Just didn't yet had the time to implement this feature because I'm busy at work. I labeled this issue with "request" so me, or anyone interested can implement the feature, just needed to comment on the issue 1st that he/she will do it so no conflicts will happen.

@ghost
Copy link

ghost commented Dec 29, 2013

\Codebird\Codebird::setConsumerKey("your_ConsumerKey", "your_ConsumerSecret");
$cb = \Codebird\Codebird::getInstance();
$cb->setToken("your_AccessToken", "your_AccessTokenSecret");
$reply = $cb->statuses_update('status=Whohoo, I just tweeted!'); 

Using Codebird all it takes to post on twitter are these few lines.
But I'm not sure where to put them.

It is better to put them in the Snippet Observer, and check every time if the approved field was changed ?

Or just, when the admin dashboard will be finished, in the method that approves the snippet?

@johnnncodes
Copy link
Owner Author

Can be on any of the following:

  • the code where approving of snippet happens like in the controller or model.
  • using events, like trigger an event in the controller/model etc... when a snippet has been approved and register the event listener on a service provider.
  • or anywhere you want where it makes sense to put them, feel free to be creative :) we can just re-organize it later if needed when you submit a PR :)

@ghost ghost self-assigned this Jan 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant