Skip to content

Instantly share code, notes, and snippets.

@sbeckeriv
Created September 20, 2011 23:16
Show Gist options
  • Save sbeckeriv/1230713 to your computer and use it in GitHub Desktop.
Save sbeckeriv/1230713 to your computer and use it in GitHub Desktop.
One bus away ruby code
ruby -e "eval ARGV[0].unpack('m').first" "cmVxdWlyZSAibmV0L2h0dHAiCnJlcXVpcmUgInBwIgpkZWYgZ2V0X3RhYmxlKHVybHMscm91dGVzKQogIGFycml2YWxzPVtdCiAgdXJscy5lYWNoIGRvIHx1cmx8CiAgICB4ID0gTmV0OjpIVFRQLmdldChVUkkucGFyc2UodXJsKSkKICAgIHguZ3N1YigiXG4iLCIiKS5tYXRjaCgvPHRhYmxlIC4qPz4oLio/KTxcL3RhYmxlPi9pb20pCiAgICB0YWJsZSA9JDEKICAgIHRhYmxlLmdzdWIhKCI8L3RyPiIsIjwvdHI+XG4iKQogICAgYXJyaXZhbHMucHVzaCh0YWJsZS5nc3ViKC88XC8/W14+XSo+LywgIiAiKS5zcGxpdCgiXG4iKS5zZWxlY3R7fHh8IHgubWF0Y2goL15ccyooI3tyb3V0ZXMuam9pbigifCIpfSlFP1xiLyl9KQogIGVuZAogIGFycml2YWxzLmZsYXR0ZW4uc29ydF9ieXt8eHwgKHh4PXguc3BsaXQoIiAiKVsxXSk9PSJOT1ciID8gMCA6IHh4LnRvX2kgfS5qb2luKCJcbiIpCmVuZApiYXNlX3VybCA9ICJodHRwOi8vd3d3Lm9uZWJ1c2F3YXkub3JnL3doZXJlL3RleHQvc3RvcC5hY3Rpb24/aWQ9MV8iCnVybHMgPSBBUkdWWzFdID8gQVJHVlsxXS5zcGxpdCgiLCIpLm1hcHt8c3wgYmFzZV91cmwrc30gOiBbYmFzZV91cmwgKyAiNjE5Il0KYnVzZXM9QVJHVlsyXSA/IEFSR1ZbMl0uc3BsaXQoIiwiKS5tYXAoJjp0b19pKSA6IFsiLioiXQpwdXRzIGdldF90YWJsZSh1cmxzLGJ1c2VzKQoK" "619" "18,17,15"
@sbeckeriv
Copy link
Author

The code gets a onebusaway site and outputs a text table of selected bus routes. Easy to encode file [File.read(path].pack("m").gsub(/\n/,'') Next up add extra args for the site and bus routes.

Why? Geeklets with out a file.

@adamloving
Copy link

Geeklet indeed.

@sbeckeriv
Copy link
Author

Updated it so you can pass it stop numbers and bus numbers. it groups them all together instead of by stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment