Menu

Tree [r16] /
 History

HTTPS access


File Date Author Commit
 CHANGES 2009-08-20 zzzen [r15] 0.6.3 (see CHANGES). Removed example-output.htm...
 COPYING 2009-08-09 zzzen [r10] Added GPL license
 README 2009-08-09 zzzen [r12] 0.6.2 (see CHANGES)
 config-example.py 2009-08-21 seefood [r16] ltr? what was I on? :-)
 config_spreadsheet-example.py 2009-08-09 zzzen [r12] 0.6.2 (see CHANGES)
 mkgdata.py 2009-08-09 zzzen [r12] 0.6.2 (see CHANGES)
 mklobby.py 2009-08-20 zzzen [r15] 0.6.3 (see CHANGES). Removed example-output.htm...

Read Me

WHAT IT DOES
This script (typically run as a cron job) cross-references
Knesset presence information (from Knesset site)
With a spreadsheet containing lobbyinst information
about how MKs are expected to vote regarding a specific
law proposal. Originally used by http://no2bio.org
for tracking MKs regarding the biometric database law
in July 2009

More info at http://mklobby.sourceforge.net

TO INSTALL
* First, you need to install:
  * python: http://python.org/ (if you don't have it already)
  * BeautifulSoup: http://pypi.python.org/pypi/BeautifulSoup/
  * gdata http://pypi.python.org/pypi/gdata/

  On debian/ubuntu you can do:
  $ sudo apt-get install python-beautifulsoup python-gdata
  
* Unpack the archive

* Copy config-example.py to config.py

  You can edit DEFAULT_GDATA_SPREADSHEET, DESIRED_VOTE,
  HTML templates and other definition according to your needs

* Copy config_spreadsheet-example.py to config_spreadsheet.py
  If you change the structure of your spreadsheet, you'll need to
  tweak it.

  Unlike config-example.py, this file is not expected to change
  in future versions of the code (at least we'll try our best :) )

* Decide which google user the script will login as in order to
  access the google spreadsheet (e.g. test.lobbyist@gmail.com).
  It is good practice to create a brand new gmail account for this,
  for security reasons.

* Go to the "example law proposal" spreadsheet at
  https://spreadsheets.google.com/ccc?key=0AsjvSfWiwwF5dC1GbFI1REJWY3k5Mjk4ckFTbTdWVVE
  and save a copy with the name "MKLobby" (or whatever the value of
  DEFAULT_GDATA_SPREADSHEET is). Make sure the script's user (in our case -
  test.lobbyist@gmail.com) has read access to the spreadsheet (it doesn't need
  edit access, so - for security reasons - don't give it these rights)

TO RUN
python mklobby.py -H [-I] [-u u] [-p p] [-o output-file] [-e error-log-file]
where:

* -H is the operation (html report). At the moment it is the *only*
  relevant operation (the rest are dead code), but it is mandatory
  for some vague reason :)

* -I can be used when the Knesset is empty (night time, weekends, etc.) for
  debugging purposes. Script will ignore realtime MK presence, and insead
  will randomly select which MKs are "present" with a probability of
  RANDOM_PRESENCE_FACTOR

* u is the google user (e.g. test.lobbyist@gmail.com or simply test.lobbyist).
  Default is GDATA_DEFAULT_USER (defined at config_spreadsheet.py)
  If not provided and GDATA_DEFAULT_USER is None - an error is raised

* p is the user's password.
  Default is GDATA_DEFAULT_PW (defined at config_spreadsheet.py)
  If not provided and GDATA_DEFAULT_PW is None - you'll be prompted for password
  
  If you don't provide --pw, you'll be prompted for the password
  [not suitable for cron jobs, of course].

* -o is the output-file (typically, something.html accessible via web)

* -e is the stderr log file. Errors are appended to it
  (so it is good practice to logrotate it)

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.