TrendsBarTrendsBar

TrendsBar Advanced Usage

TrendsBaron 12 days ago
TrendsBar Advanced Usage

TrendsBar offers rich customization features that allow you to configure the tool flexibly based on your specific needs. This article will introduce several advanced features to help you make better use of this tool.

Custom Analysis Links

The analysis feature of TrendsBar essentially works by passing keywords to different pages to view search results, helping you analyze keyword meanings and determine their viability.

Analysis pages are embedded as iframes in the sidebar for quick viewing.

You can add your frequently used analysis tool links in the settings interface to create a personalized analysis workflow. Custom Analysis Links Configuration Interface

Configuration Steps

  1. Go to the plugin settings page
  2. Find the "Analysis Settings" option
  3. Click the input field
  4. Fill in the configuration information:
    • Link Name: The name displayed in the analysis tab
    • Analysis Link: Analysis page address, use {keyword} as a placeholder
    • Redirect: If the analysis page doesn't support iframe embedding, set it to open in a new tab
  5. Click "+" to complete the addition

Usage Tips

  • Prioritize analysis links that support iframe embedding for improved efficiency
  • Choose analysis pages that can quickly determine keyword viability

Custom Scoring Service

You can configure your own scoring API to rate keywords based on specific criteria. Custom Scoring Service Configuration Interface

Configuration Steps

  1. Go to the plugin settings page
  2. Find the "Analysis Assistant" option
  3. Enable the keyword scoring service
  4. Fill in the configuration information:
    • Scoring Service: API address, use {keyword} and {value} as placeholders
    • High Score Threshold: Keywords exceeding this score will be highlighted in green
  5. Configuration saves automatically

Usage Tips

  • The scoring service should respond quickly for efficient keyword filtering
  • Scoring criteria should be reasonable and accurately reflect keyword quality

Scoring Service Example

Request Example

  • Keyword: xxx keyword
  • Search Trend: +2,550%
GET /?k=xxx keyword&v=+2,550%

Response Example

{
    "score": 100,              // Score
    "msg": "Score:100.00",     // Score message
    "detail": {
        "xxScore": 100         // Score details
    },
    "keyword": "xxx keyword",  // Keyword
    "value": " 2,550%"         // Search trend
}

Here's an example of a scoring service based on Cloudflare Worker:

// Calculate keyword score, return score and specific scoring items
const calcKeywordScore = async (keyword: string | null, value: string | null) => {
    if (!keyword) {
        return {
            score: 0,
        };
    }

    // Character length score, deduct 5 points for each character over 20, minimum score is 0
    const score = keyword.length <= 20 ? 100 : 100 - (keyword.length - 20) * 5;

    if (value.includes("飙升") || value.includes("Breakout")) {
        score = 100;
    }

    return {
        score,
        msg: "Score:" + score.toFixed(2),
        detail: {
            score,
        },
    };
};


export default {
    async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
        // Get URL object
        const url = new URL(request.url);
        // Get query parameters
        const k = url.searchParams.get('k');
        const v = url.searchParams.get('v');
        const ret = await calcKeywordScore(k, v)

        // Return JSON response
        return new Response(
            JSON.stringify({
                ...ret,
                keyword: k,
                value: v,
            }),
            {
                headers: {
                    'Content-Type': 'application/json'
                }
            }
        );
    },
} satisfies ExportedHandler<Env>;

Summary

By configuring custom analysis links and scoring services, you can create a specialized analysis tool tailored to your needs. These features not only enhance analysis efficiency but also enable integration with LLM and other services for more intelligent analysis.