Skip to content

Chealion/peddown

Repository files navigation

Pedestrian Down

With increasing deaths on Calgary's streets, it's over due for the bot to come back and remind folks of how dangerous our streets are.

History

The initial version of this was a Twitter only bot that would quote any tweet from @yyctransport with the words: "ALERT" and "pedestrian" or "ped" but not cleared. In the tweet it mentions the number and tags #yycwalk.

When Twitter/X killed bots by destroying their API, the bot was shut down.

Thanks to @yyctransport for reporting the incidents, and @RrrichardZach for the push to create the bot.

Caveats

Since the bot is dependant on the @yyctransport team at the Traffic Management Centre tweeting, not all incidents are counted and reported. For the most accurate stats, please check with @CalgaryPolice. Incidents if viewed via camera, reported via 911, and affect traffic are tweeted. [1][2]

Even with this limitation, the purpose to show just how frequent incidents occur.

Datasets

Development Details

Technology Stack

  • Language: Go
  • Database: Sqlite3

After trying go-soda, I opted to move to using earthboundkid/requests instead so I could use the v3 API which provides extra fields.

Updating dependencies

Run: go get -u && go mod tidy

Socrata Notes

"Failed to fetch incidents: 403 Forbidden"

  • Check your app token is valid
  • Ensure the token is properly exported as an environment variable

"Failed to fetch incidents: timeout"

  • Check network connectivity
  • The Calgary Open Data portal may be experiencing issues
  • Try again later or fall back to local JSON files

"unmarshal incidents: invalid character"

  • The API response format may have changed
  • Check the dataset schema at data.calgary.ca
  • Update the struct definitions in database.go if needed

Deployment Details

Please see deploy

LICENSE

Licensed with an MIT License

About

Twitter Bot. Go.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors