From 1cce2730579ae8e29a0e548cea6dc2fc0630a89a Mon Sep 17 00:00:00 2001 From: Berack96 Date: Mon, 19 Jan 2026 17:45:01 +0100 Subject: [PATCH] omdb init --- .gitignore | 3 +++ README.md | 11 ++++++++++- Services/OmdbService.cs | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 Services/OmdbService.cs diff --git a/.gitignore b/.gitignore index 0501afc..6869105 100644 --- a/.gitignore +++ b/.gitignore @@ -396,3 +396,6 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +# ======= +# MINE +APIKey.txt diff --git a/README.md b/README.md index 0a35fb1..798337a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # test-alebro -Test per colloquio \ No newline at end of file +Test per colloquio + +## Istruzioni per l'esecuzione + +Dopo aver clonato il repository, crea un file APIKey.txt nella cartella radice del progetto e inserisci l'API Key di OMDb. + +Poi esegui il progetto con: +```bash +dotnet run +``` diff --git a/Services/OmdbService.cs b/Services/OmdbService.cs new file mode 100644 index 0000000..815304c --- /dev/null +++ b/Services/OmdbService.cs @@ -0,0 +1,24 @@ + + +class OmdbService +{ + private readonly string url; + + public OmdbService() + { + var apiKey = File.ReadAllText("APIKey.txt").Trim(); + apiKey = System.Net.WebUtility.UrlEncode(apiKey); + + url = "http://www.omdbapi.com/?apikey=" + apiKey + "&"; + } + + public async void FetchMovieDetail(string id) + { + // TODO + } + + public async void FetchMovies(string searchTitle) + { + // TODO + } +} \ No newline at end of file