README (2810B)
1 Helper scripts for www.republique-numerique.fr 2 Antoine Amarilli <a3nm AT a3nm DOT net>, 2015 3 License: see COPYING (MIT license) 4 5 Requires Debian packages python3-requests, python3-bs4, python3-lxml. 6 Please refer to <http://a3nm.net/blog/republique_numerique.html> for more 7 information (in French). 8 9 - get_propositions.py USER 10 returns the list of identifiers of all opinions and modifications of USER 11 of the form "/opinions/N 1" and "/opinions/N/versions/V 1" 12 (the 1 represents a dummy positive vote) 13 14 - get_votes.py USER 15 returns the votes of USER 16 of the form "/opinions/N X" or "/opinions/N/versions/V X" 17 where X is -1, 0, or 1 18 19 - vote.py EMAIL PASSWORD 20 connects to www.republique-numerique.fr using local account EMAIL PASSWORD 21 and performs votes given on standard input in the form of get_votes.py 22 (account EMAIL/PASSWORD must have been created on www.republique-numerique.fr 23 beforehand) 24 25 - dump_all.sh DEST 26 dump raw JSON of all opinions and versions to DEST/opinions and DEST/versions 27 (also dumps a few ones that don't really exist and must be filtered) 28 - You can then pretty-print to TSV with stdump.py DEST > TSV 29 - You can create tables with maketable.sh TSV OUTPUT 30 - All of this is done in one step with tables.sh OUTPUT/ 31 32 Examples: 33 34 - to perform the same votes as USER 35 36 get_votes.py USER | vote.py YOUREMAIL YOURPASS 37 38 - to vote for all propositions and opinions of USER 39 40 get_propositions.py USER | vote.py YOUREMAIL YOURPASS 41 42 Known limitations: 43 44 - Votes on arguments cannot be reliably distinguished from votes on opinions and 45 versions. The code tries to check from the title, but it could be wrong. The 46 code may reject a vote erroneously (so some votes may be missing), or mistake 47 a vote on an argument for a vote on the corresponding opinion or modification 48 (in which case a favorable vote on the corresponding item may be erroneously 49 counted). This could probably be solved reliably using the API, but it is not 50 documented and I can't figure out how to do. 51 52 - Subject to the limitations above, votes on arguments are discarded. Ideally 53 one could want to retrieve and redo them as well, but retrieving such votes 54 and identifying the correct argument would be brittle anyway (it could only 55 look at the title) 56 57 - get_propositions.py and get_votes.py are slow due to the need to perform up to 58 2 requests per item. Again, this could probably be avoided with adequate usage 59 of the undocumented API. 60 61 WARNING: These scripts are provided to simplify your life only. Please use them 62 responsibly. I do not accept any responsibility for any erroneous votes that 63 this tool may do on your behalf. I do not encourage any form of ballot stuffing 64 or other abusive behavior. 65 66 Related work: https://git.framasoft.org/etalab/moissonneur-republique-numerique 67