New NER Discord Bot for Twitter Closures

Coordinator: orbitc & ARC: Banished
------------------------------------------------------------

Moderators: delilush, orbitc, banished

New NER Discord Bot for Twitter Closures

Postby itismejoey » Thu Mar 07, 2019 10:29 pm

Hello New England (and everyone else)!

When I first joined the NER Discord I noticed that there was an unused #twitterfeed channel that appeared to go unused for a while. I could tell that the leadership was most likely using webhooks and most likely a service like IFTTT (If This Then That), which was later confirmed. The downside with using IFTTT is that sometimes there would be up to a 15 minute delay from when the tweet was sent out publicly to when it would be sent to the webhook channel.

With the help of johnninja58 and Elli21486, as well as the support from the NER SMs, I would like to introduce the new way NER will be getting Twitter updates sent straight to its Discord.

NER Traffic Alerts is a Discord bot account that is coded using JS (JavaScript). The bot utilizes Twitter's API to look at specific Twitter accounts and pull certain tweets, based on a filter, and post them in a state's Twitter feed. Because the bot is looking directly at the Twitter API and checking every 60 seconds, the tweet will be sent to the channel usually within 60 seconds from being posted.

Below I have listed the current Twitter accounts that we are following for each state:

Code: Select all
CT: CT_STATE_POLICE, CTDOT_Statewide, TollandAlert

Code: Select all
MA: "MassStatePolice, MassDCR, MassDOT, TotalTrafficBOS, lawrencepolice, HaverhillPolice, TewksburyPD, WBZTraffic, ChelseaScanner, reverescanner, 5_13Dist, LowellPD, WilmingtonMAPD, WorcesterEM, bostonpolice, SpencerMAPolice, BelmontPD, MethuenPolice, DanversPolice, Falmouth_Police

Code: Select all
ME: MEStatePolice, MaineTurnpike, MaineDOT1

Code: Select all
NH: NH_StatePolice, NHDOTRoutes, nhdoti93, NHDOTI293, NHDOTNH101, NHDOTI89, NHDOTEverett, NHDOTSpaulding, manch_nh_hiway, pelhamnhpolice, rocksheriffnh, HamptonNHPD, ConcordNHGS, AtkinsonPolice, DoverNHPolice, nashuadpw

Code: Select all
RI: RIStatePolice, RIDOTNews

Code: Select all
VT: VTStatePolice, VTDMV, 511VT


Most of the above Twitter accounts were used during testing and can be modified in anyway, based on what each SM decides they'd like in their feed. Just let me know and I can change it!

The bot looks for the following words in a tweet to send an alert:
Code: Select all
closed, closure, all lanes closed, ramp blocked, off-ramp, ramp open, ramp reopen, ramp re-open, traffic alert

But will also filter out a tweet if it has the following:
Code: Select all
one lane, two lanes, right lane, right travel lane, rtl, left lane, left travel lane, LTL, except right, except left, center lane, 2 lanes, 1 lane, partial, sidewalk, 3 right lanes, 3 left lanes, shoulder open, breakdown lane open, break down lane open, office, library, clear, cleared, report , service center, school, Tech, Institute, College, University, DMV, RMV, advance notice, advanced notice, overnight, intermittently, temporary


If you have any issues that you notice, such as certain tweets making it through the filter when they shouldn't have, please don't hesitate to reach out!
Last edited by itismejoey on Fri Mar 22, 2019 6:03 pm, edited 2 times in total.
Level 3 editor
AM New Hampshire (Derry area)
Southern NH/Merrimack Valley Mass
itismejoey
 
Posts: 7
Joined: Mon Oct 15, 2018 5:51 am
Has thanked: 2 times
Been thanked: 8 times

Re: New NER Discord Bot for Twitter Closures

Postby johnsninja58 » Fri Mar 08, 2019 12:18 am

Thank itismejoey I see that the first tweet has fed into CT. I think this will be a huge help for the community and appreciate your time and energy making this happen.
-John
-------
[ img ][ img ]
VT - State Manager
New England - Multi State Manager
johnsninja58
PartnerCoordinator
PartnerCoordinator
 
Posts: 979
Joined: Thu Jul 23, 2015 4:05 am
Location: New England
Has thanked: 479 times
Been thanked: 496 times

Re: New NER Discord Bot for Twitter Closures

Postby nhmapguy » Fri Mar 08, 2019 1:28 am

I like the idea! I am concerned that some of the filters will restrict tweets that should make it through. Who will be monitoring the filtered exclusion tweets to see if tweets that should make it through aren't filtered out?
nhmapguy
Area Manager
Area Manager
 
Posts: 33
Joined: Tue Oct 08, 2013 4:47 pm
Location: Seacoast, NH
Has thanked: 15 times
Been thanked: 6 times

Re: New NER Discord Bot for Twitter Closures

Postby johnsninja58 » Fri Mar 08, 2019 2:36 am

If you find examples please bring them to itismejoey attention. While there will be scenarios due to the filtering that a tweet might be missed. That is a longer term optimization task. Right now we have no tweets going into the server, having a reliable feed is critical otherwise people will tune things out. As we get more comfortable with the feeds we can definitely explore adjusting the filtering. It would also be good to evaluate if any twitter accounts should be added.
-John
-------
[ img ][ img ]
VT - State Manager
New England - Multi State Manager
johnsninja58
PartnerCoordinator
PartnerCoordinator
 
Posts: 979
Joined: Thu Jul 23, 2015 4:05 am
Location: New England
Has thanked: 479 times
Been thanked: 496 times

Re: New NER Discord Bot for Twitter Closures

Postby nhmapguy » Fri Mar 08, 2019 2:50 am

Sounds good. I'll have to create a Twitter list and stay on top of it. I was also going to recommend accounts as I saw them.
nhmapguy
Area Manager
Area Manager
 
Posts: 33
Joined: Tue Oct 08, 2013 4:47 pm
Location: Seacoast, NH
Has thanked: 15 times
Been thanked: 6 times

Re: New NER Discord Bot for Twitter Closures

Postby Spenceman2023 » Fri Mar 08, 2019 3:33 am

All the New Hampshire accounts look good. They mainly tweet out all the accidents that occur on the respective interstate or highway the account is attached to. Although sometimes they can be vague and not have a reason to why a lane is closed
Spenceman2023
 
Posts: 1
Joined: Fri May 13, 2016 6:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: New NER Discord Bot for Twitter Closures

Postby itismejoey » Fri Mar 08, 2019 4:14 am

nhmapguy wrote:Who will be monitoring the filtered exclusion tweets to see if tweets that should make it through aren't filtered out?

Great question! So I still have my own semi-private Discord specifically for Waze. It's where I keep track of any current or future projects that I am working on. What John suggested to me is to have a secondary feed that posts tweets without the exclusion filter, just to make sure we aren't missing anything.

We've been looking at this for almost a month and I think we got it pretty good right now. I also monitor over 400 accounts, while at work or on the computer at home, and get alerts for specific filters. Most of the time I'll get alerted on TweetDeck and from the Discord bot at the same time.

Spenceman2023 wrote:Although sometimes they can be vague and not have a reason to why a lane is closed

That's frustrating sometimes, but as Moogonk said once in the Discord, "If authorities are asking for people to avoid a location, I generally put in a closure to give them room to work." Sometimes we just have to mark a road as closed without a reason or we can try and dig deeper to find that reason (I personally like to dig).
Level 3 editor
AM New Hampshire (Derry area)
Southern NH/Merrimack Valley Mass
itismejoey
 
Posts: 7
Joined: Mon Oct 15, 2018 5:51 am
Has thanked: 2 times
Been thanked: 8 times

Re: New NER Discord Bot for Twitter Closures

Postby itismejoey » Fri Mar 08, 2019 6:23 am

nhmapguy wrote:Sounds good. I'll have to create a Twitter list and stay on top of it. I was also going to recommend accounts as I saw them.

Also, yes please!

As you can see, I do have a couple local agencies on the list that I know are good about posting closures. I just added WilmingtonMAPD and WorcesterEM, for Mass. I am going to go through my followed list and see who else is good about posting closures.

If you're looking for a good start on accounts to follow, you can look at what I have followed so far. https://twitter.com/itismewaze/following
Level 3 editor
AM New Hampshire (Derry area)
Southern NH/Merrimack Valley Mass
itismejoey
 
Posts: 7
Joined: Mon Oct 15, 2018 5:51 am
Has thanked: 2 times
Been thanked: 8 times

Re: New NER Discord Bot for Twitter Closures

Postby Elli21486 » Fri Mar 08, 2019 6:34 am

itismejoey wrote:
nhmapguy wrote:Who will be monitoring the filtered exclusion tweets to see if tweets that should make it through aren't filtered out?

Great question! So I still have my own semi-private Discord specifically for Waze. It's where I keep track of any current or future projects that I am working on. What John suggested to me is to have a secondary feed that posts tweets without the exclusion filter, just to make sure we aren't missing anything.

We've been looking at this for almost a month and I think we got it pretty good right now. I also monitor over 400 accounts, while at work or on the computer at home, and get alerts for specific filters. Most of the time I'll get alerted on TweetDeck and from the Discord bot at the same time.

Just to continue on this, I am also monitoring Twitter and Facebook so there's more than one user in regards to monitoring social media. There are things however such as weather damage or fires, that would unfortunately need to be manually reviewed due to the nature of those events as they can have many variables.

Overall though, the bot did quite well during our last storm.
Elli21486
 
Posts: 152
Joined: Tue Oct 08, 2013 5:01 am
Has thanked: 1 time
Been thanked: 23 times

Re: New NER Discord Bot for Twitter Closures

Postby itismejoey » Fri Mar 08, 2019 10:59 am

Added "overnight" to the exclude filter, because MassDOT felt like replying to some people this morning and the tweets met all requirements to be posted. I assume that most overnight closures won't result in full lane closures.

Edit: This might be changed at a later date, since MassDOT does overnight closures on ramps. This will still get caught by the bot, but will be posted in a different server/channel if it includes "overnight".
Level 3 editor
AM New Hampshire (Derry area)
Southern NH/Merrimack Valley Mass
itismejoey
 
Posts: 7
Joined: Mon Oct 15, 2018 5:51 am
Has thanked: 2 times
Been thanked: 8 times

Next

Return to US New England

Who is online

Users browsing this forum: No registered users