Go to Post it is easy. you will have to define "easy" in your own terms. - Mike Martus [more]
Home
Go Back   Chief Delphi > Other > FIRST-related Organizations > The Blue Alliance
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-31-2016, 11:52 AM
mikhail's Avatar
mikhail mikhail is offline
Registered User
AKA: Mentor of The Software ERRORs
FRC #3130 (ERRORS)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Minnesota
Posts: 18
mikhail is an unknown quantity at this point
[TBA]: TBA to Slack integration

I wonder if anyone already succeeded to integrate The Blue Alliance with Slack (http://slack.com/). Our team 3130 is using Slack for all teamwork communications as well as for keeping in touch with parents and all other fans of the team. I'd expect some other teams might do the same. So my thinking is it would be great if there was a way to have a channel for TBA updates into Slack that everyone on the team could monitor and didn't have to poll the TBA servers individually.

I can see TBA provides an API for push notifications via webhooks. The Slack can receive webhook POST requests as well. The only problem is how to reshape TBA's payload into Slack's format (https://api.slack.com/incoming-webhooks). Technically it should be possible to do either on TBA side or Slack side or on an intermediate http server. Have anyone tried any of these opportunities yet? Thank you.

Last edited by mikhail : 03-31-2016 at 02:04 PM. Reason: URLs got the parentheses in
Reply With Quote
  #2   Spotlight this post!  
Unread 03-31-2016, 12:04 PM
joelg236 joelg236 is offline
ATA Head Mentor & Alumni
AKA: Joel Gallant
FRC #4334 (ATA)
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 739
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

If nobody has done this already, I'd totally be willing to help do it. Would be pretty awesome to have. We run a #live channel for watching streams and whatnot, so a "favorite teams" bot would be a perfect addition.
__________________
All opinions are my own.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-31-2016, 12:19 PM
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
no team (The Blue Alliance)
Team Role: Engineer
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC
Posts: 1,214
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

I love this idea! As the original author of TBA webhooks, it's awesome to see people come up with cool uses for them.

I think you're going to have to build your own server somehow to receive TBA webhooks and post to slack. I say so because TBA webhooks just return the raw data associated with an event. It does not return a human-readable string about what happened. It'll be best to let end users (you) decide how you want your messages to read and to format them yourself.

That being said, I'll definitely watch what you do with interest, and hope that you open source it!
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
The Blue Alliance | The Blue Alliance for Android | FRC Notebook
Reply With Quote
  #4   Spotlight this post!  
Unread 03-31-2016, 01:02 PM
Eugene Fang's Avatar
Eugene Fang Eugene Fang is offline
The Blue Alliance
FRC #0604 (Quixilver)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Bay Area, CA -> Pittsburgh, PA
Posts: 1,051
Eugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond reputeEugene Fang has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

Quote:
Originally Posted by plnyyanks View Post
I think you're going to have to build your own server somehow to receive TBA webhooks and post to slack. I say so because TBA webhooks just return the raw data associated with an event. It does not return a human-readable string about what happened. It'll be best to let end users (you) decide how you want your messages to read and to format them yourself.
I'm pretty the custom server could fully run within the free quota of Google App Engine. Just a thought.
__________________
Eugene Fang
2010 Silicon Valley Regional Dean's List Finalist

Various FLL Teams - Student (2000-2006), Mentor (2007-2010)
FRC Team 604 - Student (2007-2010), Mentor/Remote Advisor (2011-Present)
FRC Team 1323 - Mentor/Remote Advisor (2011-2014)

The Blue Alliance | TBA GameDay | TBA Android App | TBA Blog | TBA Swag
Reply With Quote
  #5   Spotlight this post!  
Unread 03-31-2016, 01:21 PM
joelg236 joelg236 is offline
ATA Head Mentor & Alumni
AKA: Joel Gallant
FRC #4334 (ATA)
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 739
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

Quote:
Originally Posted by Eugene Fang View Post
I'm pretty the custom server could fully run within the free quota of Google App Engine. Just a thought.
Or heroku, rackspace, etc. very easily. Depends if you wanted to offer this as a public service or ask teams to deploy it themselves (easy enough).
__________________
All opinions are my own.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-31-2016, 11:30 PM
mikhail's Avatar
mikhail mikhail is offline
Registered User
AKA: Mentor of The Software ERRORs
FRC #3130 (ERRORS)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Minnesota
Posts: 18
mikhail is an unknown quantity at this point
Re: [TBA]: TBA to Slack integration

This is so cool. Thanks for responses guys! I went ahead and created an account on Google App Engine for myself. They gave me 60 days of free trial - plenty for this season. Then we will see. Now I'm thinking what programming language to use. I'd guess following TBA it would be Python, right? Shall we create a project on GitHub? Of course it must be open source, not a tiny doubt about that.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-01-2016, 09:16 AM
joelg236 joelg236 is offline
ATA Head Mentor & Alumni
AKA: Joel Gallant
FRC #4334 (ATA)
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 739
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

Quote:
Originally Posted by mikhail View Post
This is so cool. Thanks for responses guys! I went ahead and created an account on Google App Engine for myself. They gave me 60 days of free trial - plenty for this season. Then we will see. Now I'm thinking what programming language to use. I'd guess following TBA it would be Python, right? Shall we create a project on GitHub? Of course it must be open source, not a tiny doubt about that.
Can I suggest a simple nodejs app that ingests TBA through this and serves slack JSON?

example
__________________
All opinions are my own.
Reply With Quote
  #8   Spotlight this post!  
Unread 04-01-2016, 11:33 AM
mikhail's Avatar
mikhail mikhail is offline
Registered User
AKA: Mentor of The Software ERRORs
FRC #3130 (ERRORS)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Minnesota
Posts: 18
mikhail is an unknown quantity at this point
Re: [TBA]: TBA to Slack integration

Quote:
Originally Posted by joelg236 View Post
Can I suggest a simple nodejs app that ingests TBA through this and serves slack JSON?

example
That's a wonderful library for polling TBA with GET requests. Must be a really powerful tool to run in a browser. What I was thinking of was a library to receive and parse POST requests from TBA so then the data could be recomposed into another POST and sent to Slack's webhook.
Reply With Quote
  #9   Spotlight this post!  
Unread 04-01-2016, 11:56 AM
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
no team (The Blue Alliance)
Team Role: Engineer
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC
Posts: 1,214
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

Quote:
Originally Posted by mikhail View Post
This is so cool. Thanks for responses guys! I went ahead and created an account on Google App Engine for myself. They gave me 60 days of free trial - plenty for this season. Then we will see. Now I'm thinking what programming language to use. I'd guess following TBA it would be Python, right? Shall we create a project on GitHub? Of course it must be open source, not a tiny doubt about that.
App Engine actually has a free tier, and you shouldn't need any more resources that that. Python works nicely on App Engine, so that's a perfectly fine choice (other GAE choices are Java, Go, and PHP)

Quote:
Originally Posted by joelg236 View Post
Can I suggest a simple nodejs app that ingests TBA through this and serves slack JSON?

example
I'm not sure that library works if webhooks are used. The server wouldn't actually poll the TBA API, the flow would go something like this:

TBA ---(webhook)---> GAE (process, format) -----(Slack Message)---> Slack
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
The Blue Alliance | The Blue Alliance for Android | FRC Notebook
Reply With Quote
  #10   Spotlight this post!  
Unread 04-01-2016, 11:57 AM
joelg236 joelg236 is offline
ATA Head Mentor & Alumni
AKA: Joel Gallant
FRC #4334 (ATA)
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 739
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: [TBA]: TBA to Slack integration

Quote:
Originally Posted by plnyyanks View Post
App Engine actually has a free tier, and you shouldn't need any more resources that that. Python works nicely on App Engine, so that's a perfectly fine choice (other GAE choices are Java, Go, and PHP)



I'm not sure that library works if webhooks are used. The server wouldn't actually poll the TBA API, the flow would go something like this:

TBA ---(webhook)---> GAE (process, format) -----(Slack Message)---> Slack
You're totally right, I had it mixed up in my head. Makes sense.
__________________
All opinions are my own.
Reply With Quote
  #11   Spotlight this post!  
Unread 04-04-2016, 11:41 PM
mikhail's Avatar
mikhail mikhail is offline
Registered User
AKA: Mentor of The Software ERRORs
FRC #3130 (ERRORS)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Minnesota
Posts: 18
mikhail is an unknown quantity at this point
Re: [TBA]: TBA to Slack integration

Update:
I finally succeeded connecting the two webhooks: from TBA to Slack. Yay! It's a -nasty hack- convoluted Python script running on Google Apps. So far it is very simplistic, basically just stripping JSON formatting for a couple of message types. I can't open-source it yet because all the URLs and secrets are hard coded into the script. I'll see how it works this upcoming weekend then will try to rewrite it in a more open-source-able form (after I'm done with my taxes as well). Stay tuned.
Reply With Quote
  #12   Spotlight this post!  
Unread 05-09-2016, 10:45 PM
mikhail's Avatar
mikhail mikhail is offline
Registered User
AKA: Mentor of The Software ERRORs
FRC #3130 (ERRORS)
Team Role: Mentor
 
Join Date: Dec 2014
Rookie Year: 2013
Location: Minnesota
Posts: 18
mikhail is an unknown quantity at this point
Re: [TBA]: TBA to Slack integration

Alright. Sorry for the delay, our team 3130 happened to win its second regional and had to go to the world champs. So all our resources were taken by the preps. Now as the competitions season is over I managed to scratch some time to publish our code onto GitHub. Here it is.

https://github.com/team3130/TBA-push-to-Slack/

That's a very basic example we tested in our Slack team. So far only "Upcoming Match" and "Match Score" notifications are implemented. And even those are very basic.

I'd love to hear suggestions how to make the project more collaborative so others could contribute. For the starters the major conflict I already can see would be that if this project grows further everyone will want their own formatting for messages. For the meantime I have no idea how to handle that. Please chime in.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:30 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi