{"id":19817592,"url":"https://github.com/nirantak/wsiwn","last_synced_at":"2025-05-01T11:30:54.749Z","repository":{"id":36666264,"uuid":"151813675","full_name":"nirantak/wsiwn","owner":"nirantak","description":"What Should I Watch Next? Expert System built using Python/Flask and Prolog.","archived":false,"fork":false,"pushed_at":"2022-07-15T11:54:13.000Z","size":312,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-01T16:23:49.211Z","etag":null,"topics":["expert-system","flask","prolog","python","python3","react","swi-prolog","web-scraping"],"latest_commit_sha":null,"homepage":"","language":"Prolog","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nirantak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"nirantak"}},"created_at":"2018-10-06T07:00:20.000Z","updated_at":"2023-03-04T08:46:41.000Z","dependencies_parsed_at":"2022-09-24T18:50:51.770Z","dependency_job_id":null,"html_url":"https://github.com/nirantak/wsiwn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirantak%2Fwsiwn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirantak%2Fwsiwn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirantak%2Fwsiwn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nirantak%2Fwsiwn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nirantak","download_url":"https://codeload.github.com/nirantak/wsiwn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224253344,"owners_count":17280934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expert-system","flask","prolog","python","python3","react","swi-prolog","web-scraping"],"created_at":"2024-11-12T10:13:05.858Z","updated_at":"2024-11-12T10:13:06.749Z","avatar_url":"https://github.com/nirantak.png","language":"Prolog","funding_links":["https://github.com/sponsors/nirantak"],"categories":[],"sub_categories":[],"readme":"# WSIWN\n\n\u003e *What Should I Watch Next?*\n\n## Table of Contents\n\n- [WSIWN](#wsiwn)\n  - [Table of Contents](#table-of-contents)\n  - [Usage](#usage)\n  - [Technology Stack](#technology-stack)\n  - [Working](#working)\n  - [REST API Endpoints](#rest-api-endpoints)\n\n## Usage\n\n- Install [Docker](https://hub.docker.com/search/?type=edition\u0026offering=community) and [Docker Compose](https://docs.docker.com/compose/install/)\n\n- Run web app\n\n    ```shell\n    $ docker-compose up\n    ```\n\n    or\n\n- Run Prolog\n\n    ```shell\n    $ docker-compose run api bash\n    $ swipl server/prolog/movies.pl\n    $ swipl server/prolog/tv.pl\n    ```\n\n    Execute queries\n    ```prolog\n    ?- movies(X, Z).\n    ?- movies(X, L, G, D, Y).\n\n    ?- tv(X, Z).\n    ?- tv(X, L, G, D, S, T).\n    ```\n\n    where\n\n    - X: Output variable (byte string)\n    - Z: Input Search term (str)\n    - L: Language (str)\n    - G: Genre (str)\n    - D: Duration {short, avg, long}\n    - Y: Year (int)\n    - S: Number of Seasons (int)\n    - T: Status {ended, airing}\n\n## Technology Stack\n\n- Language - [Python3](https://www.python.org)\n- Framework - [Flask](https://palletsprojects.com/p/flask/)\n- Logic Programming - [SWI-Prolog](http://www.swi-prolog.org)\n- Python - SWI-Prolog Bridge - [GitHub](https://github.com/yuce/pyswip), [SWIPL](http://www.swi-prolog.org/contrib/)\n- DevOps - [Docker](https://www.docker.com/get-started)\n\n## Working\n\n- [Web Scraping](https://github.com/nirantak/wsiwn/blob/master/server/scripts/scraper.py) - Scrape a website to get top 100 movies and TV shows sorted by popularity. Results are here: [Movies](https://github.com/nirantak/wsiwn/blob/master/server/data/movies.txt), [TV Shows](https://github.com/nirantak/wsiwn/blob/master/server/data/tv.txt).\n- [Fetch Data](https://github.com/nirantak/wsiwn/blob/master/server/scripts/seed_data.py#L15) - Fetch information from OMDB API about each record from previous step. Results are here: [Movies](https://github.com/nirantak/wsiwn/blob/master/server/data/movies.json), [TV Shows](https://github.com/nirantak/wsiwn/blob/master/server/data/tv.json).\n- Write [Prolog Statements](https://github.com/nirantak/wsiwn/blob/master/server/scripts/seed_data.py#L49) - Write Prolog facts for each record from the previous step and add search queries. Results are here: [Movies](https://github.com/nirantak/wsiwn/blob/master/server/prolog/movies.pl), [TV Shows](https://github.com/nirantak/wsiwn/blob/master/server/prolog/tv.pl).\n\n## REST API Endpoints\n\n---\n| Method[name] | URI                      | Description                                                                                                                            |\n| ------------ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |\n| GET[movies]  | /api/movies?query=string | Display Movies matching query string                                                                                                   |\n| GET[tv]      | /api/tv?query=string     | Display TV shows matching query string                                                                                                 |\n| POST[movies] | /api/movies              | Search Movies with params (at least 1): [language(str), genre(str), duration{short, avg, long}, year(int)]                             |\n| POST[tv]     | /api/tv                  | Search TV shows with params (at least 1): [language(str), genre(str), duration{short, avg, long}, seasons(int), status{airing, ended}] |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirantak%2Fwsiwn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnirantak%2Fwsiwn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnirantak%2Fwsiwn/lists"}