2
1
Fork
You've already forked 2mmis
1
A text interface for Toronto City Council meetings, agendas, and minutes.
  • Shell 100%
2023年12月14日 17:28:46 -05:00
2mmis.sh Major revamp 2023年12月10日 18:06:48 -05:00
README.md Fixed formatting 2023年12月14日 17:28:46 -05:00

2mmis.sh

A text interface for Toronto City Council meetings, agendas, and minutes

Why?

Because due to the scarcity of power outlets and my old ThinkPad's dwindling battery life, I often boot straight into the virtual console (/dev/tty1) to use my computer in a text-only mode while liveblogging Toronto City Council and committee meetings. Thanks to programs like tmux, toot, alpine, and lynx, I can still get a lot of stuff done. Unfortunately TMMIS, the Toronto City Council site where agendas and items are posted, is inaccessible with text-only browsers. However, they did recently implement an API which I can query with jq!

How do I use this?

Installation

Requirements:

  • Linux, I guess
  • bash >= 4.x
  • curl
  • jq >= 1.5

Recommendations:

  • less to easily browse longer files
  • a text-only browser like lynx or w3m
  • pdftotext (part of poppler-utils)

Save the script to a folder in your $PATH (e. g. ~/.local/bin; check ~/.bash_profile), make it executable with chmod +x ~/the/folder/you/put/it/in/2mmis.sh, and make sure your computer knows about it by doing . .bashrc.

Usage

Usage: 2mmis.sh [optional option]

Options:

-c,--committee <number> Show details for the committee specified by the number used in TMMIS URLs.
-h,--help Show this help message.
-i,--item <code> Show the item page URL. The format is <year>.<ctte><meeting number>.<item number>, e.g. 2023.BL1.1. You must include the year.
-m,--meeting <number> Show agenda for the meeting specified by the number used in TMMIS URLs.
-s,--schedule Show this month's schedule.

If you already know the meeting/committee number or item code that you want,, or if you want to look at the current month's schedule, you can quickly bring up the information with the command-line options. Otherwise 2mmis.sh will run in interactive mode, presenting you with numbered lists of options to choose from:

  • Recent & upcoming meetings
    • See a list of recent and upcoming meetings. You can enter a meeting's number to see the agenda.
  • Monthly schedule
    • See the current month's schedule, or enter any month and year. (The month must not have a leading 0: e.g. for January, enter 1 and not 01.) This schedule includes events like holidays and agency board meetings that aren't included in TMMIS.
  • Council & committees
    • See City Council and a list of all its committees. You can enter a committee's number to see a list of its meetings this term, and then enter a meeting number to see its agenda (if it has been published).
  • About 2mmis.sh
    • Read the help text.

If you are in a graphic environment, you can select or click on URLs to open them in your browser. In a terminal multiplexer like tmux, you can enter copy mode to copy URLs and open them with a browser like lynx or w3m.

For PDFs, you can copy the link and pass it to a program like pdftotext (if you do not have it, install the package poppler-utils). For example, curl -s https://example.com/file.pdf | pdftotext - - will extract a PDF's text and display it in your terminal window. (Optionally, add | less to easily browse and search long documents.)

To do

There is a lot of room for improvement, because I am very bad at programming.

  • Implement loops, etc., to make things more efficient.
  • Implement smarter navigation options instead of just dumping you out and making you start again. Also, fix loops.
  • Make the formatting prettier.
  • Add command-line flags and help.
  • Add the monthly schedule (削除) (currently requires a cookie) (削除ここまで) I FUCKING FIGURED OUT HOW TO DO THE COOKIES
  • Group schedule events by day
  • Allow getting more information for events on schedule screen
  • Add Meeting Monitor features (only when a meeting is ongoing?)
  • Make it easier to detect/specify a browser and pager to use
  • Pipe more info (committee information, meeting agendas) through the pager?
  • Add option to dump HTML content to stdout using terminal-based browser and pager
  • Number agenda items in meeting view to make them easy to select
  • Make it handle committee information with null values more gracefully
  • Make it handle prompts with nothing entered more gracefully
  • Add man page? I always like it when programs have man pages.
  • Sort out terminology to distinguish between choosing a menu option and entering a string