omdb init

This commit is contained in:
2026-01-19 17:45:01 +01:00
parent 34aef8b8bc
commit 1cce273057
3 changed files with 37 additions and 1 deletions

3
.gitignore vendored
View File

@@ -396,3 +396,6 @@ FodyWeavers.xsd
# JetBrains Rider # JetBrains Rider
*.sln.iml *.sln.iml
# =======
# MINE
APIKey.txt

View File

@@ -1,3 +1,12 @@
# test-alebro # test-alebro
Test per colloquio 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
```

24
Services/OmdbService.cs Normal file
View File

@@ -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
}
}