Return a structured string describing paste search findings.
(pastes: list[dict], query: str)
| 50 | |
| 51 | |
| 52 | def _format_paste_results(pastes: list[dict], query: str) -> str: |
| 53 | """Return a structured string describing paste search findings.""" |
| 54 | if not pastes: |
| 55 | return f"No pastes found mentioning '{query}'." |
| 56 | |
| 57 | count = len(pastes) |
| 58 | shown = pastes[:_MAX_RESULTS] |
| 59 | lines = [f"Found in {count} paste(s) for '{query}':\n"] |
| 60 | for paste in shown: |
| 61 | paste_id = paste.get("id", "unknown") |
| 62 | date = paste.get("time", "unknown date") |
| 63 | lines.append(f"[+] https://pastebin.com/{paste_id} ({date})") |
| 64 | if count > _MAX_RESULTS: |
| 65 | lines.append(f"\n... and {count - _MAX_RESULTS} more.") |
| 66 | return "\n".join(lines) |
| 67 | |
| 68 | |
| 69 | async def run_paste_osint( |
no outgoing calls