Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[F] - Too common words in title #28

Open
perisicnikola37 opened this issue Jan 25, 2025 · 0 comments
Open

[F] - Too common words in title #28

perisicnikola37 opened this issue Jan 25, 2025 · 0 comments
Assignees
Labels
feature implement new feature help wanted Extra attention is needed

Comments

@perisicnikola37
Copy link
Owner

perisicnikola37 commented Jan 25, 2025

Description:
This feature will identify overused, common words in the article title that could make it less engaging or generic. It will flag titles that contain frequently used or non-specific words, offering suggestions for improvement.

Steps:

  1. Create a list of common words (e.g., "shocking", "incredible", "will shock you") using an external word frequency list.
  2. Analyze the post title by comparing it to the list of common words.
  3. Flag the title and suggest alternatives based on word choice.
function isClickbait(title: string): boolean {
    // List of phrases that usually indicate clickbait titles
    const clickbaitPatterns = [
        "incredible",
        "you won't believe",
        "best ever",
        "shocking",
        "discover",
        "you have to read this",
        "will shock you",
        "the biggest secret",
        "everything you didn't know",
        "solve this problem forever",
        "a miracle that changes the world",
        "the way to",
        "how to become",
        "you'll never guess"
    ];

    const lowerCaseTitle = title.toLowerCase();

    for (let pattern of clickbaitPatterns) {
        if (lowerCaseTitle.includes(pattern)) {
            return true;
        }
    }

    return false;
}

function calculateScore(title: string, baseScore: number): number {
    if (isClickbait(title)) {
        return baseScore - 7; 
    }
    return baseScore; 
}

// Test example
const title = "Incredible! This trick will change your life!";
const baseScore = 10;

const finalScore = calculateScore(title, baseScore);
console.log(`Final score: ${finalScore}`);
@perisicnikola37 perisicnikola37 added the feature implement new feature label Jan 26, 2025
@perisicnikola37 perisicnikola37 added this to the v3.x milestone Jan 26, 2025
@perisicnikola37 perisicnikola37 self-assigned this Jan 30, 2025
@perisicnikola37 perisicnikola37 added the help wanted Extra attention is needed label Jan 30, 2025
@perisicnikola37 perisicnikola37 removed this from the v3.x milestone Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature implement new feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants