Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 77: Line 77:
     const FN_POST = 'Post & Schedule';
     const FN_POST = 'Post & Schedule';
     const FN_ANALYSIS = 'Analysis';
     const FN_ANALYSIS = 'Analysis';
    const FN_METRICS = 'Metrics';


     const getUrl = title =>  title ? '/index.php/Special:FilePath/' + title : title;
     const getUrl = title =>  title ? '/index.php/Special:FilePath/' + title : title;
Line 123: Line 124:
             'Sentiment analysis',
             'Sentiment analysis',
             'Trend analysis'
             'Trend analysis'
        ];
        const metricsFunctions = [
            'Post metrics',
            'Profile or Site metrics',
            'Network metrics',
            'Follower metrics',
            'Audience metrics',
            'Competitor metrics'
         ];
         ];


Line 131: Line 140:
                         searchFunctions.map(func => '|?' + func).join('') +
                         searchFunctions.map(func => '|?' + func).join('') +
                         postFunctions.map(func => '|?' + func).join('') +
                         postFunctions.map(func => '|?' + func).join('') +
                         analysisFunctions.map(func => '|?' + func).join('')
                         analysisFunctions.map(func => '|?' + func).join('') +
                        metricsFunctions.map(func => '|?' + func).join('')
                         ;
                         ;
         const dctQueryUrl = '/api.php?action=ask&format=json&query=' + encodeURIComponent(dctQuery);
         const dctQueryUrl = '/api.php?action=ask&format=json&query=' + encodeURIComponent(dctQuery);
Line 152: Line 162:
             if (hasFunction(dctResult, postFunctions)) dct.functions.push(FN_POST);
             if (hasFunction(dctResult, postFunctions)) dct.functions.push(FN_POST);
             if (hasFunction(dctResult, analysisFunctions)) dct.functions.push(FN_ANALYSIS);
             if (hasFunction(dctResult, analysisFunctions)) dct.functions.push(FN_ANALYSIS);
            if (hasFunction(dctResult, metricsFunctions)) dct.functions.push(FN_METRICS);


             return dct;
             return dct;

Revision as of 16:10, 9 June 2022

Development verstion of the DCT List.
Not ready for production!