diff --git a/README.md b/README.md index ad0c667..18c169c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,36 @@ # FreeCompetitors -A search tool for free software replacements. \ No newline at end of file +A search tool for free software replacements. + +# How to add new software: + +In the [apps](apps) folder there are a bunch of json files for software. Here is an example: + +- `names` what the software is called. +- `comment` description of the software. +- `links` Various links to learn more about the software e.g. `git` (where the source code can be found if it it's available), `website` (software's website if it exists) and `wikipedia` if there is some wiki. At least one of these needs to be there. +- `icon` a **link** to the icon of the software. For now no images will be stored in the repository so it takes up less space. +- `platforms` where the software can be accessed from e.g. Linux, Windows, Android, iOS, Mac. For websites just write `Web`. +- `networks_read` if the software uses something like a [network](https://en.wikipedia.org/wiki/Social_networking_service). This means the software is able to view content on that network. +- `networks_write` if the software uses something like a [network](https://en.wikipedia.org/wiki/Social_networking_service). This means the software is able to do stuff like publish or write comments on the network. +- `formats_write` if the software can write files to your system what formats does it support. +- `generic_name` names that can be used to describe what the software is. +- `issues` if the software has privacy related issues. + +```json +{"names":["YouTube", + "You Tube", + "youtube.com", + "youtu.be"], + "comment":"A platform for uploading and watching videos.", + "links":{"website":"https://youtube.com", + "wikipedia":"https://en.wikipedia.org/wiki/YouTube", + "icon":"https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/YouTube_full-color_icon_%282017%29.svg/120px-YouTube_full-color_icon_%282017%29.svg.png"}, + "platforms":["Android", "iOS","Web"], + "networks_read":["youtube"], + "networks_write":["youtube"], + "formats_read":[], + "formats_write":[], + "generic_name":["Video Player", "YouTube Client", "Music Player", "Publication"], + "issues":["Surveillance", "Non-Free Software", "Non-Free JavaScript", "DRM"]} +``` diff --git a/modules/__pycache__/render.cpython-38.pyc b/modules/__pycache__/render.cpython-38.pyc index 7e330c6..1c1263c 100644 Binary files a/modules/__pycache__/render.cpython-38.pyc and b/modules/__pycache__/render.cpython-38.pyc differ diff --git a/modules/__pycache__/search.cpython-38.pyc b/modules/__pycache__/search.cpython-38.pyc index 0827494..8bf4006 100644 Binary files a/modules/__pycache__/search.cpython-38.pyc and b/modules/__pycache__/search.cpython-38.pyc differ diff --git a/server.py b/server.py index 44cd5d2..5b7d792 100644 --- a/server.py +++ b/server.py @@ -6,14 +6,6 @@ # web-masters and a like, so we are counting on # your ability to set it up and running. -CSS = "https://zortazert.codeberg.page/style/styles.css" -PORT = input("Port: ") -try: - PORT = int(PORT) -except: - print("Port should be a number") - exit() - # Server side from http.server import BaseHTTPRequestHandler, HTTPServer from subprocess import * @@ -23,6 +15,19 @@ import os from modules import search from modules import render +CSS = "https://zortazert.codeberg.page/style/styles.css" +try: + with open("port.json","r") as f: + json_stuff = json.load(f) + PORT = json_stuff["port"] +except: + PORT = input("Port: ") +try: + PORT = int(PORT) +except: + print("Port should be a number") + exit() + # Who fucking made this http.server so I need to use classes? # I fucking hate who ever thought that it was a good idea...