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 slack integration #284

Merged
merged 1 commit into from
Sep 16, 2015
Merged

Add slack integration #284

merged 1 commit into from
Sep 16, 2015

Conversation

yasakbulut
Copy link

lol-slack

This PR adds a new plugin that handles image upload to slack; to share the awesomeness with friends, coworkers and envious nemeses.

The upload is done using the Slack Web API File Upload. The files are stored on slack, and posted to a channel/several channels specified in the configuration.

Heavily inspired by (read: copied from) lol-yammer and uploldz.

Configuration

lol-slack needs a valid user token in order to function. You can generate a personal token via the Slack Web API.
Additionally, you can specify in which channels or private groups to which the images should be posted. Simply enter a comma-separated list of channel IDs.

lolcommits --config -p slack

Configuring plugin: slack
enabled: true
Open the URL below and issue a token for your user:
https://api.slack.com/web
Enter the generated token below, then press enter: (e.g. xxxx-xxxxxxxxx-xxxx)
[User Token]
Enter a comma-seperated list of channel IDs to post images in, then press enter: (e.g. C1234567890,C1234567890)
[Channel ID(s)]

Notes

  • At the time of writing, the master branch had 5 RuboCop offenses, and 1 failed feature test (On My Machine:tm:). This branch does not increase those numbers (On My Machine:tm:)
  • Suggestions, nitpickings and flame-wars are welcome

@tooluser
Copy link

tooluser commented Sep 3, 2015

This is fantastic!

@tooluser
Copy link

Any chance this'll get merged?

@matthutchinson
Copy link
Member

I think i'll get a chance to look at it tomorrow, sorry for the delay.

@tooluser
Copy link

Hey, that's great! I was just worried it was dead or otherwise stale. Busy I can relate to... And once I have slack I can hook up the whole dept!

Joshua Marker
"Future site of beautiful San Andreas Canyon."

On Sep 12, 2015, at 10:45, Matthew Hutchinson notifications@github.com wrote:

I think i'll get a chance to look at it tomorrow, sorry for the delay.


Reply to this email directly or view it on GitHub.

@matthutchinson
Copy link
Member

Sorry, i'm "slack"ing on this I know, tomorrow night for sure 👍

@tooluser
Copy link

OIC what you did there. ;-)

On Sep 12, 2015, at 10:45, Matthew Hutchinson notifications@github.com wrote:

I think i'll get a chance to look at it tomorrow, sorry for the delay.


Reply to this email directly or view it on GitHub #284 (comment).

@matthutchinson
Copy link
Member

Ok, I took a look and it all looks and works great. The one thing that threw me was the need to pass a Channel ID (and not a channel name). I might make this more clear in the config help text after merging, or calling this endpoint to find channels by name first.

In any case, merging now, and will push a new point release out ASAP. Sorry this took so long to review and merge and thanks for your contribution!

matthutchinson added a commit that referenced this pull request Sep 16, 2015
@matthutchinson matthutchinson merged commit f852d0e into lolcommits:master Sep 16, 2015
@matthutchinson
Copy link
Member

FYI, I applied this commit after merging.

@tooluser
Copy link

This is like christmas morning!

On Sep 16, 2015, at 08:14, Matthew Hutchinson notifications@github.com wrote:

FYI, I applied this commit 79c26f4 after merging.


Reply to this email directly or view it on GitHub #284 (comment).

@matthutchinson
Copy link
Member

I've added this feature request issue just now - so perhaps someone (or my future self) will get to it.

@yasakbulut
Copy link
Author

Hey, thanks for your comments and the merge! I might take a look at the feature request in the future, but don't count on it just yet =)

@yasakbulut yasakbulut deleted the lol-slack branch September 17, 2015 13:56
@matthutchinson
Copy link
Member

Hi @yasakbulut 👋

So you may (or may not) have noticed that we recently extracted all lolcommit plugins to external gems!

🏅 Since you contributed this slack plugin, I've added you (as an admin) to the new lolcommits-slack repo.

Of course you are under no obligation to maintain this code or gem going forward. This is just a quick message to explain what has happened and give you the opportunity to take ownership again.

If you're interested in picking this up, send me your email address (to matt/at/hiddeloop.com) and I'll add you as a new gem owner (with publishing rights) here.

Otherwise I will continue to maintain the gem, and make sure things are kept up to date.


To get an idea of how gem plugins work, check out the sample_plugin README / RubyDocs or browse through other plugin code.

The main reasons for extraction were to:

  • remove the ever-growing gem dependency list in the main lolcommits gem
  • start to unify configuration code for plugins (common helpers, approaches to OAuth etc.)
  • make lolcommit plugin development easier
  • add more comprehensive plugin tests

That's it, any questions just let me know.

Happy coding!

Matt

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