|
1 | 1 | # Monumental |
2 | 2 |
|
3 | 3 | Reasonator for monuments |
4 | | - |
5 | | -## Server |
6 | | - |
7 | | -A small python server providing authorization for edit actions on Wikidata. |
8 | | - |
9 | | -### Local setup |
10 | | - |
11 | | -1. Install python requirements |
12 | | - |
13 | | -```bash |
14 | | -pip install -r requirements.txt |
15 | | -``` |
16 | | - |
17 | | -2. Setup config.yaml |
18 | | - |
19 | | -Copy config.default.yaml to config.local.yaml. You may need to add oauth consumer info, which you can apply for [here](https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose). If you need a set of keys for testing purposes (running on localhost:5000), you can email me at <stephen.laporte@gmail.com>. |
20 | | - |
21 | | -3. Run the dev server |
22 | | - |
23 | | -```bash |
24 | | -python monumental/server.py |
25 | | -``` |
26 | | - |
27 | | -Test it out: |
28 | | - |
29 | | - - Login: http://localhost:5000/login |
30 | | - - A simple Wikidata API query: http://localhost:5000/api?action=query&list=random&rnnamespace=0&rnlimit=10 |
31 | | - - Get an edit token (with authorization): http://localhost:5000/api?action=query&meta=tokens&use_auth=true |
32 | | - |
33 | | -See [here](https://www.wikidata.org/w/api.php) for full Wikidata API docs. |
34 | | - |
35 | | -### License |
36 | | - |
37 | | -Copyright (c) 2017, Stephen LaPorte |
38 | | - |
39 | | -Redistribution and use in source and binary forms, with or without |
40 | | -modification, are permitted provided that the following conditions are |
41 | | -met: |
42 | | - |
43 | | - * Redistributions of source code must retain the above copyright |
44 | | - notice, this list of conditions and the following disclaimer. |
45 | | - |
46 | | - * Redistributions in binary form must reproduce the above |
47 | | - copyright notice, this list of conditions and the following |
48 | | - disclaimer in the documentation and/or other materials provided |
49 | | - with the distribution. |
50 | | - |
51 | | - * The names of the contributors may not be used to endorse or |
52 | | - promote products derived from this software without specific |
53 | | - prior written permission. |
54 | | - |
55 | | -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
56 | | -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
57 | | -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
58 | | -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
59 | | -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
60 | | -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
61 | | -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
62 | | -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
63 | | -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
64 | | -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
65 | | -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
0 commit comments