[ home / overboard ] [ soy / qa / raid / r ] [ craft ] [ int / pol ] [ a / an / asp / biz / mtv / r9k / tech / v / sude / x ] [ q / news / chive / rules / pass / bans / status ] [ wiki / booru / irc ]

A banner for soyjak.party

/pol/ - International /Pol/itics & /Bant/er

Politics & countrywars
Catalog
Name
Email
Subject
Comment
Flag
File
Password (For file deletion.)

File: IMG_2854.jpeg 📥︎ (61.17 KB, 474x592) ImgOps

 â„–2926501[Quote]

It scrapes models.com and then builds a family tree from the womens info so we can see their true genetic value

import requests
from bs4 import BeautifulSoup
import time
from neo4j import GraphDatabase

# Step 1: Scrape models.com (pseudocode)
def scrape_models_com():
url = "https://models.com"
response = requests.get(url, headers={"User-Agent": "Mozilla/5.0"})
soup = BeautifulSoup(response.text, "html.parser")
models = []
for model in soup.select(".model-profile"):
name = model.select_one(".name").text
birthdate = model.select_one(".birthdate").text
models.append({"name": name, "birthdate": birthdate})
return models

# Step 2: Query WikiTree API
def query_wikitree(name, birthdate):
api_url = f"https://api.wikitree.com/api.php?action=query&format=json&list=search&srsearch={name}"
response = requests.get(api_url)
data = response.json()
# Parse data for matches
return data

# Step 3: Store in Neo4j
def store_in_neo4j(model_data, family_data):
uri = "bolt://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "password"))
with driver.session() as session:
session.run(
"""
CREATE (m:Model {name: $name, birthdate: $birthdate})
CREATE (f:Family {data: $family_data})
CREATE (m)-[:HAS_FAMILY]->(f)
""",
name=model_data["name"],
birthdate=model_data["birthdate"],
family_data=family_data
)

# Step 4: Run the pipeline
if name == "main":
models = scrape_models_com()
for model in models:
family_data = query_wikitree(model["name"], model["birthdate"])
if family_data:
store_in_neo4j(model, family_data)
time.sleep(5) # Be polite

 â„–2926531[Quote]

Nophono

 â„–2926538[Quote]

Nobeidore

 â„–2926594[Quote]

>>2926538
>>2926531
class ModelsComGenealogyBot:
def init(self):
self.base_url = "https://www.models.com"
self.session = requests.Session()
self.session.headers.update({
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
})
self.genealogy_graph = nx.DiGraph()
self.processed_models = set()

# Setup logging
logging.basicConfig(level=logging.INFO)
self.logger = logging.getLogger(name)

def get_model_page(self, model_url):
"""Fetch and parse a model's profile page"""
try:
response = self.session.get(model_url, timeout=10)
response.raise_for_status()
return BeautifulSoup(response.content, 'html.parser')
except requests.RequestException as e:
self.logger.error(f"Error fetching {model_url}: {e}")
return None

def extract_model_info(self, soup, model_url):
"""Extract model information from profile page"""
if not soup:
return None

model_info = {
'url': model_url,
'name': self._extract_name(soup),
'family_members': self._extract_family_connections(soup)
}
return model_info

def _extract_name(self, soup):
"""Extract model's name"""
name_element = soup.find('h1', class_='model-name') or soup.find('title')
if name_element:
return name_element.get_text(strip=True)
return "Unknown"

def _extract_family_connections(self, soup):
"""Extract family connections from model profile"""
family_connections = []

# Look for family-related text in various elements
potential_elements = soup.find_all(['p', 'div', 'span'])

family_keywords = ['mother', 'father', 'sister', 'brother', 'daughter',
'son', 'parent', 'child', 'family', 'related to']

for element in potential_elements:
text = element.get_text().lower()
if any(keyword in text for keyword in family_keywords):
# Extract potential names and relationships
connection = self._parse_family_text(text, element)
if connection:
family_connections.append(connection)

return family_connections

def _parse_family_text(self, text, element):
"""Parse family relationship text"""
# This is a simplified parser - you might want to enhance it with NLP
relationships = {}

if 'mother' in text:
relationships['mother'] = self._find_names_in_text(text)
if 'father' in text:
relationships['father'] = self._find_names_in_text(text)
if 'sister' in text:
relationships['sister'] = self._find_names_in_text(text)
if 'brother' in text:
relationships['brother'] = self._find_names_in_text(text)
if 'daughter' in text:
relationships['daughter'] = self._find_names_in_text(text)
if 'son' in text:
relationships['son'] = self._find_names_in_text(text)

return relationships if relationships else None

def _find_names_in_text(self, text):
"""Simple name extraction - could be improved with NLP"""
import re
# Basic pattern for names (capitalized words)
name_pattern = r'\b[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*\b'
names = re.findall(name_pattern, text)
# Filter out common words that might be capitalized
common_words = {'The', 'And', 'Or', 'But', 'For', 'Nor', 'As', 'At', 'By', 'In', 'Of', 'On', 'To', 'Up', 'Via', 'With'}
return [name for name in names if name not in common_words and len(name) > 2]

def search_models(self, query=None, max_results=50):
"""Search for models on models.com"""
models = []
page = 1

while len(models) < max_results:
search_url = f"{self.base_url}/search?q={query or ''}&page={

 â„–2926627[Quote]

Any nelp appreciated

 â„–2926631[Quote]

>>2926627
what help do you need exactly

 â„–2926643[Quote]

>>2926631
Not sure. This is all code from ai from 30 minutes ago. I dont know how to code

 â„–2926706[Quote]

>>2926643
ai is good in making these kinds of things. nowadays, you don't have to be a codeGOD to write complex programs. the only thing you have to know is what the generated code even means. and ai can only give you the code you want if you prompt well enough.

 â„–2926717[Quote]

I can vibe code good. The trick is 1st asking the ai to give you a prompt to ask an Ai to write you a code suffecient for your task. That is, if you want to '1 shot' it.
<REDDIT
Are you wanting this to be a constantly running app, or a script or something?

 â„–2929066[Quote]

>>2926717
Id like to map the genes of every female model on models dot com

 â„–2929104[Quote]

blud thinks i know how to code

 â„–2929203[Quote]

>>2926717
Did you make this app for me

 â„–2929263[Quote]

>>2929104
Try and make it



[Return][Catalog][Go to top][Post a Reply]
Delete Post [ ]
[ home / overboard ] [ soy / qa / raid / r ] [ craft ] [ int / pol ] [ a / an / asp / biz / mtv / r9k / tech / v / sude / x ] [ q / news / chive / rules / pass / bans / status ] [ wiki / booru / irc ]