diff --git a/backend/banners.py b/backend/banners.py index 42ddf0e..1264df6 100644 --- a/backend/banners.py +++ b/backend/banners.py @@ -1,4 +1,4 @@ -from .functions import get_location_details +from backend.functions import get_location_details # Banner banner = """ @@ -23,7 +23,7 @@ """ -def print_geo_coordinater(lat, lon): +def print_geo_coordinates(lat, lon): print("[ * ] Harvesting information based on the next coordinates:") print("\t[ * * ] Latitude: ", lat) print("\t[ * * ] Longitude:", lon) diff --git a/backend/combine_data.py b/backend/combine_data.py index 1fe762b..4a942a3 100644 --- a/backend/combine_data.py +++ b/backend/combine_data.py @@ -1,5 +1,5 @@ -from .functions import combine_json_files -from .json_into_html import generate_html_from_json +from backend.functions import combine_json_files +from backend.json_into_html import generate_html_from_json def combine_data(report_json_directory="./reports-json/", report_html_directory="./reports-html/"): diff --git a/start.py b/start.py index d753346..def3315 100644 --- a/start.py +++ b/start.py @@ -16,7 +16,7 @@ print_combined_data, print_current_step, print_files_stored, - print_geo_coordinater, + print_geo_coordinates, print_len_steps, print_start_harvesting, print_successfully, @@ -77,19 +77,6 @@ pattern = generate_pattern((calculate_length(meters + 400) + 800) // 200) # Adjust the length as needed (x / 2 - 2) current_datetime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") -# Store the initial coordinates and initialize lists to store the coordinates for each step -initial_latitude = latitude -initial_longitude = longitude -step_coordinates = [] - -# Initialize variables to store coordinates and counts -coordinates = [] -coordinates_count = 0 -coordinates_sum = [0, 0] - -# Extract users with distance 500 -filtered_users = [] - # Initialize an empty dictionary to store user data users_data = {} step = 0 @@ -108,27 +95,21 @@ # Banner logo print(banner) -# Printing geo cordinates -print_geo_coordinater(latitude, longitude) +# Printing geo coordinates +print_geo_coordinates(latitude, longitude) # Printing city and country by coordinates print_city_by_geo(latitude, longitude) -# Perform steps according to the pattern -for i, steps in enumerate(pattern): - if i == 0: - direction = "starting" - elif i % 4 == 1: - direction = "west" - elif i % 4 == 2: - direction = "south" - elif i % 4 == 3: - direction = "east" - else: - direction = "north" +# Calculate steps according to the pattern and store it in the step_coordinates var +directions = ("north", "west", "south", "east") +direction = "starting" +step_coordinates = [] +for i, steps in enumerate(pattern, start=1): for _ in range(steps): latitude, longitude = calculate_coordinates(latitude, longitude, direction, 0.6) # 600 meters in kilometers step_coordinates.append((latitude, longitude)) + direction = directions[i % 4] # Print number of steps print_len_steps(len(step_coordinates), meters)