Log in

View Full Version : CDBot - The Chief Delphi "New Thread" Bot on ##FRC


pimathbrainiac
31-08-2014, 21:05
For those of you who frequent ##FRC, I made a bot for you that scans the RSS feed and alerts the channel when there is a new thread. It also has a few other functions (some useful, some not). Here's a list of them:

.google [search] - Googles [search] and outputs the link and the title
.test - outputs "test received"
.ping [url] - pings [url] and outputs the response code and whether or not the ping was successful.

There are a few others, though. You can look at the source for the rest of the commands: https://github.com/pimathbrainiac/CDPostBot

EDIT: It didn't detect this post. It is a work in progress, after all :/

icecube45
31-08-2014, 21:20
For those of you who frequent ##FRC, I made a bot for you that scans the RSS feed and alerts the channel when there is a new thread. It also has a few other functions (some useful, some not). Here's a list of them:

.google [search] - Googles [search] and outputs the link and the title
.test - outputs "test received"
.ping [url] - pings [url] and outputs the response code and whether or not the ping was successful.

There are a few others, though. You can look at the source for the rest of the commands: https://github.com/pimathbrainiac/CDPostBot

EDIT: It didn't detect this post. It is a work in progress, after all :/

It just detected it

pimathbrainiac
01-09-2014, 12:47
Okay, so it's not instantaneous. It must be due to the RSS feed not updating instantaneously. Good to know. Thanks for the notice. Next function will be match scores, synced with TBA, if that' possible.

plnyyanks
01-09-2014, 15:13
Next function will be match scores, synced with TBA, if that' possible.

It's very much possible. TBA has an API (http://www.thebluealliance.com/apidocs) that you can poll for changes. Additionally, if I get the time in the coming weeks, I'm going to work on adding webhook functionality, which will make it even easier.

pimathbrainiac
01-09-2014, 18:29
Thanks. I saw the API and am working on handing the json right now. I will also add lookup commands for past matches and events. I'll post an update here when it is done.

EDIT: It appears that there is something wrong with the API, or the way it works. When I use this (http://www.thebluealliance.com/api/v2/events/2014) url in chrome, I get the response data. When I use the same URL In Java, I get error code 400. Any ideas?

plnyyanks
01-09-2014, 20:14
EDIT: It appears that there is something wrong with the API, or the way it works. When I use this (http://www.thebluealliance.com/api/v2/events/2014) url in chrome, I get the response data. When I use the same URL In Java, I get error code 400. Any ideas?

Are you supplying the proper "X-Tba-App-Id" header to identify your request? I can run the following command and get the proper response back.
curl --header "X-Tba-App-Id:foo:baz:baz" http://www.thebluealliance.com/api/v2/events/2014

If you need some help with using the API through java, take a look at this file (https://github.com/the-blue-alliance/the-blue-alliance-android/blob/master/android/src/main/java/com/thebluealliance/androidclient/datafeed/HTTP.java#L25) in the TBA Android app - it should be a good starting point.

pimathbrainiac
01-09-2014, 21:32
I forgot. Thanks for that! I added it as a URL param.
Also thanks for the file link. That should come in handy!

pimathbrainiac
12-09-2014, 06:28
Some major improvements have been made recently. I'm working on tba lookups right now (with the last score of an event, some event data, etc. already done). I also added a .cdsearch function so you can search CD from IRC. I'll document everything once this is finished. For now, if you want to check things, you should go look at my source code on GitHub (and star it, while you're at it).

pimathbrainiac
16-12-2014, 17:13
It's been a while since I've posted here.

I have added a .help command, as well as some code for a very nice surprise once the competitions start :D