Moiz commited on
Commit
c1b881b
·
1 Parent(s): 2c523f3

new API key

Browse files
Files changed (3) hide show
  1. .DS_Store +0 -0
  2. .gitignore +2 -0
  3. database.py +2 -2
.DS_Store CHANGED
Binary files a/.DS_Store and b/.DS_Store differ
 
.gitignore CHANGED
@@ -1 +1,3 @@
1
  .DS_Store
 
 
 
1
  .DS_Store
2
+ .env
3
+ .DS_Store
database.py CHANGED
@@ -1,6 +1,6 @@
1
  import requests
2
  import pandas as pd
3
- import json
4
 
5
  # Load CSV
6
  try:
@@ -20,7 +20,7 @@ database = pd.DataFrame(columns=column_names)
20
 
21
  # Define function to fetch movie details and save in DataFrame
22
  def get_movie(movie_id):
23
- api_key = "f2443b04"
24
  url = f"http://www.omdbapi.com/?apikey={api_key}&i={movie_id}&plot=full"
25
  try:
26
  response = requests.get(url)
 
1
  import requests
2
  import pandas as pd
3
+ import os
4
 
5
  # Load CSV
6
  try:
 
20
 
21
  # Define function to fetch movie details and save in DataFrame
22
  def get_movie(movie_id):
23
+ api_key = os.getenv("API_KEY")
24
  url = f"http://www.omdbapi.com/?apikey={api_key}&i={movie_id}&plot=full"
25
  try:
26
  response = requests.get(url)