MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / analyze_social_github

Method analyze_social_github

IntelOSINT.py:17442–17480  ·  view source on GitHub ↗
(self, username, base)

Source from the content-addressed store, hash-verified

17440 return info
17441
17442 def analyze_social_github(self, username, base):
17443 url = f"https://github.com/{urllib.parse.quote(username)}"
17444 img = base["icon"]
17445 info = {"Status": " Richiesta API", "Profile": url}
17446 try:
17447 if "@" in username:
17448 sr = requests.get(f"https://api.github.com/search/users?q={urllib.parse.quote(username)}&per_page=1", timeout=10)
17449 if sr.status_code == 200:
17450 items = sr.json().get("items", [])
17451 if items:
17452 username = items[0].get("login") or username
17453 url = f"https://github.com/{urllib.parse.quote(username)}"
17454 info["Username da email"] = username
17455 r = requests.get(f"https://api.github.com/users/{urllib.parse.quote(username)}", timeout=10)
17456 if r.status_code == 404:
17457 return [self._social_result("GitHub", username, {"Status": " Non Trovato"}, img, 404, url, False)]
17458 if r.status_code != 200:
17459 return None
17460 d = r.json()
17461 info["Status"] = " Online (API GitHub)"
17462 if d.get("name"): info["Nome"] = d.get("name")
17463 if d.get("bio"): info["Bio"] = str(d.get("bio")).replace('\n', ' ')
17464 if d.get("location"): info["Location"] = d.get("location")
17465 if d.get("company"): info["Azienda"] = d.get("company")
17466 if d.get("blog"): info["Website"] = d.get("blog")
17467 if d.get("twitter_username"): info["X"] = d.get("twitter_username")
17468 if d.get("avatar_url"):
17469 info["Avatar GitHub"] = d.get("avatar_url")
17470 info["Image"] = d.get("avatar_url")
17471 info["Followers"] = str(d.get("followers", 0))
17472 info["Following"] = str(d.get("following", 0))
17473 info["Repo Pubbliche"] = str(d.get("public_repos", 0))
17474 if d.get("created_at"): info["Iscritto il"] = d.get("created_at")[:10]
17475 if d.get("updated_at"): info["Aggiornato il"] = d.get("updated_at")[:10]
17476 if d.get("id"): info["ID Utente"] = str(d.get("id"))
17477 info.update(self._github_osgint_enrich(username, d))
17478 return [self._social_result("GitHub", username, info, d.get("avatar_url", img), 200, d.get("html_url", url), True)]
17479 except Exception:
17480 return None
17481
17482 def analyze_social_reddit(self, username, base):
17483 api_url = f"https://www.reddit.com/user/{urllib.parse.quote(username)}/about.json"

Callers

nothing calls this directly

Calls 2

_social_resultMethod · 0.95
_github_osgint_enrichMethod · 0.95

Tested by

no test coverage detected