help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
whatsapp-chatbot
/
static
/
js
RSK World
whatsapp-chatbot
WhatsApp Chatbot - Python Flask + Twilio + Admin Dashboard + Multilingual Support + Sentiment Analysis + Booking Management
js
  • admin.js1.6 KB
admin.js
static/js/admin.js
Raw Download
Find: Go to:
// Fetch Analytics Data
document.addEventListener('DOMContentLoaded', function() {
    fetch('/api/analytics')
        .then(response => response.json())
        .then(data => {
            // Update Total
            document.getElementById('total-interactions').innerText = data.total_interactions;

            // Update Chart
            const ctx = document.getElementById('sentimentChart').getContext('2d');
            new Chart(ctx, {
                type: 'doughnut',
                data: {
                    labels: ['Positive', 'Neutral', 'Negative'],
                    datasets: [{
                        data: data.sentiment_counts,
                        backgroundColor: ['#28a745', '#ffc107', '#dc3545'],
                        borderWidth: 0
                    }]
                },
                options: { plugins: { legend: { position: 'bottom' } } }
            });

            // Update Activity List
            const list = document.getElementById('activity-list');
            list.innerHTML = '';
            if (data.recent_intents && data.recent_intents.length > 0) {
                data.recent_intents.reverse().slice(0, 5).forEach(intent => {
                    const li = document.createElement('li');
                    li.className = 'list-group-item';
                    li.innerText = 'User Intent: ' + intent;
                    list.appendChild(li);
                });
            } else {
                 list.innerHTML = '<li class="list-group-item text-muted">No recent activity</li>';
            }
        })
        .catch(err => console.error("Failed to load analytics:", err));
});
40 lines•1.6 KB
javascript

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer