Skip to content
/ cufaoil Public

Tool and library for gathering historical bin collection data from Greyhound Recycling

Notifications You must be signed in to change notification settings

nosmo/cufaoil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cú Faoil

Cú Faoil is the Irish word for wolfhound. Due to convention and restriction, the fada is dropped in various places

cufaoil.py is a simple script for logging into and then dumping or serving historical information about bin collections from the Greyhound bin company. The greyhound module it uses contains all of the login/query logic and can be reused elsewhere.

cufaoil.py always requires a username and password to run (username in this case is what Greyhound calls an account ID, password is the PIN).

Prometheus

Cú Faoil can serve bin collection data using Prometheus when invoked with the -d switch. The daemon will mostly sleep but once a day (default configuration) it will check for updates to the bin data. If a new bin weight is seen, a metric will be emitted. This gauge is named cufaoil_bin_weight:

# HELP cufaoil_bin_weight The weight of the observed bin collection
# TYPE cufaoil_bin_weight gauge
cufaoil_bin_weight{bincolour="green"} 13.0
cufaoil_bin_weight{bincolour="brown"} 15.5
cufaoil_bin_weight{bincolour="black"} 3.0

Graphing this data is the main reason I wrote this tool. It's dumb as hell and I love it. Fight me.

Adding a new company

Once you've figured out the URLs and HTTP actions required for your bin company, simply implement login() and get_data() in the cufaoil module.

Known difficult companies:

  • Citybin uses Recaptcha on logins

Dumping bin info

When no other arguments are provided, a simple pretty-print of the data is emitted. -c and -j CSVify and JSONise the output respectively.

Bugs

Oh yeah it'll do that.

About

Tool and library for gathering historical bin collection data from Greyhound Recycling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages