Skip to content

Conversation

@GYFX35
Copy link
Owner

@GYFX35 GYFX35 commented Sep 6, 2025

Summary by Sourcery

Expand platform coverage and add browser-based URL analysis while updating heuristics for comprehensive scam detection

New Features:

  • Support fake profile analysis across multiple new platforms including Telegram, Twitter, Pinterest, LinkedIn, and others
  • Introduce a 'browser' option to perform URL-based scam detection

Enhancements:

  • Expand safe domain mappings and suspicious URL patterns to cover the newly added platforms
  • Add forex and trading-related terms to the suspicious keyword list

This commit expands the social media analyzer tool to support a wider range of platforms, including social media, communication, and e-commerce sites.

The following platforms have been added:
- Telegram
- Twitter
- Pinterest
- LinkedIn
- Line
- Discord
- Teams
- Zoom
- Amazon
- Alibaba

The changes include:
- Updating the platform list in `main.py` to make the new platforms selectable.
- Adding legitimate domains for the new platforms to `heuristics.py` and updating the suspicious URL patterns.
- Providing platform-specific advice for identifying fake profiles or scams on the new platforms in `fake_profile_detector.py`.
This commit further expands the social media analyzer tool to support a wider range of platforms and introduces email analysis capabilities.

The following platforms have been added:
- YouTube
- Skype
- VK
- Reddit
- Email

The changes include:
- Updating the platform list in `main.py` to make the new platforms and email analysis selectable.
- Adding legitimate domains for the new platforms to `heuristics.py` and updating the suspicious URL patterns.
- Providing platform-specific advice for the new platforms in `fake_profile_detector.py`.
- Adding specific advice for analyzing emails, focusing on sender details and content.
This commit expands the social media analyzer tool to support a wider range of platforms and enhances scam detection capabilities.

The following platforms have been added:
- Viber
- Signal
- Badoo
- Binance

The changes include:
- Updating the platform list in `main.py`.
- Adding legitimate domains and updating suspicious URL patterns in `heuristics.py`.
- Adding platform-specific advice for the new platforms in `fake_profile_detector.py`.
- Enhancing email analysis advice with Gmail-specific tips.
- Adding Forex-related keywords to the scam detection engine to improve its effectiveness against financial scams.
This commit adds support for the ShareChat platform and introduces a new "Browser" option for direct URL analysis.

The changes include:
- Adding "sharechat" and "browser" to the platform list in `main.py`.
- Implementing a special workflow for the "browser" option to allow users to analyze a URL directly.
- Adding legitimate domains and platform-specific advice for ShareChat.
- Updating the suspicious URL patterns to include ShareChat.

This work is in response to user requests to add more platforms and to interpret the request for browser integration as a feature for URL analysis.
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 6, 2025

Reviewer's Guide

This PR broadens platform coverage by adding detection rules for numerous social networks, extends the main UI to handle a new 'browser' analysis mode with expanded platform listing, and strengthens heuristic patterns and domain whitelists to support the added platforms and new scam vectors.

Class diagram for updated heuristics and platform support

classDiagram
    class Heuristics {
        +SAFE_DOMAINS: dict
        +SUSPICIOUS_KEYWORDS: list
        +SUSPICIOUS_URL_PATTERNS: list
    }
    class FakeProfileDetector {
        +analyze_profile_based_on_user_input(profile_url, platform)
        +PLATFORM_FAKE_PROFILE_TIPS: dict
    }
    class ScamDetector {
        +analyze_text_for_scams(message, platform)
        +is_url_suspicious(url)
    }
    Heuristics <.. ScamDetector : uses
    FakeProfileDetector <.. Heuristics : uses
    ScamDetector <.. FakeProfileDetector : uses
Loading

Flow diagram for main.py platform selection and analysis logic

flowchart TD
    A["Start"] --> B["Display platform list (expanded)"]
    B --> C["User selects platform"]
    C --> D{Is platform 'browser'?}
    D -- Yes --> E["Prompt for URL"]
    E --> F["Analyze URL for suspicious patterns"]
    F --> G["Display URL analysis results"]
    D -- No --> H["Prompt for profile or message analysis"]
    H --> I{User chooses profile or message}
    I -- Profile --> J["Prompt for profile URL"]
    J --> K["Analyze profile for fake signs"]
    K --> L["Display profile analysis results"]
    I -- Message --> M["Prompt for message"]
    M --> N["Analyze message for scam indicators"]
    N --> O["Display scam analysis results"]
Loading

File-Level Changes

Change Details Files
Added detection heuristics for a wide range of new platforms
  • Introduced platform-specific fake profile checks for Telegram, Twitter, Pinterest, LinkedIn, and others
  • Populated detailed scam indicator lists for 26 additional platforms
  • Standardized rule structure to accommodate future platform expansions
social_media_analyzer/fake_profile_detector.py
Extended main application flow and platform enumeration
  • Expanded the platforms array to include browser URL analysis and 27 new services
  • Implemented a dedicated 'browser' code path for URL suspension detection
  • Refactored input loops to integrate the new analysis options seamlessly
social_media_analyzer/main.py
Enhanced heuristic definitions and regex patterns
  • Added safe domain mappings for all newly supported platforms
  • Augmented scam keyword list with trading and forex-related terms
  • Updated suspicious URL regex to cover the full set of supported platforms
social_media_analyzer/heuristics.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@GYFX35 GYFX35 merged commit 5276c45 into main Sep 6, 2025
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants