Automatically monitor and log fan counters from social media(Facebook Pages, Twitter, Instagram, YouTube, Google+, OneSignal, Alexa) using APIs to Google Spreadsheet. Very useful for website admins and social media managers.
git clone https://github.com/adam0white/Social-Media-Monitor.gitSocial-Media-Monitor is a Google Apps Script that automatically tracks follower counts, likes, and subscriber numbers from major social platforms—Facebook Pages, Twitter, Instagram, YouTube, Google+, OneSignal, and Alexa—logging them daily to Google Sheets without manual effort. The script pulls data via APIs and URL parsing, enabling long-term trend analysis and chart creation directly in your spreadsheet. Website admins and social media managers use it to monitor audience growth across multiple channels in one place. Setup requires copying the script, configuring API keys as needed, and scheduling daily automated runs through Google Apps Script triggers. It eliminates the tedious daily manual tracking that typically consumes social media management time.
Copy the Google Apps Script, remove unneeded functions, add required API keys, and run the MAIN_SAVE_DATA function to test. Create a daily trigger via Edit > Current project's triggers to automate collection. Optionally copy the example spreadsheet to analyze data and build charts.
Track follower growth across Facebook, Twitter, and Instagram from a single dashboard
Monitor YouTube subscriber trends over time with automated daily logging
Analyze social media audience metrics historically and create performance charts
Automate OneSignal subscriber count tracking for push notification campaigns
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/adam0white/Social-Media-MonitorCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create a Google Apps Script to monitor and log fan counters from social media platforms (Facebook Pages, Twitter, Instagram, YouTube, Google+, OneSignal, Alexa) using their APIs. The script should update a Google Spreadsheet with the latest follower counts every [FREQUENCY] (e.g., daily, weekly). Include error handling for API rate limits and ensure the script can handle [NUMBER] of social media accounts. Provide the complete script code and instructions for setup.
```javascript
// Social Media Monitor Script
function monitorSocialMedia() {
// Define social media platforms and their API endpoints
const platforms = {
facebook: {
url: 'https://graph.facebook.com/v12.0/[PAGE_ID]/insights/page_fan_counts',
apiKey: '[FACEBOOK_API_KEY]'
},
twitter: {
url: 'https://api.twitter.com/2/users/[USER_ID]',
apiKey: '[TWITTER_API_KEY]'
},
// Add other platforms similarly
};
// Open the Google Spreadsheet
const sheet = SpreadsheetApp.openById('[SPREADSHEET_ID]').getActiveSheet();
// Loop through each platform and fetch follower counts
for (const [platform, config] of Object.entries(platforms)) {
const options = {
headers: {
'Authorization': `Bearer ${config.apiKey}`
}
};
try {
const response = UrlFetchApp.fetch(config.url, options);
const data = JSON.parse(response.getContentText());
const followerCount = data.[PLATFORM_SPECIFIC_FIELD]; // e.g., data.followers_count for Twitter
// Log the data to the spreadsheet
sheet.appendRow([new Date(), platform, followerCount]);
} catch (error) {
console.error(`Error fetching data from ${platform}: ${error.toString()}`);
}
}
}
```
### Instructions for Setup
1. **Create a Google Spreadsheet**: Set up a new Google Spreadsheet to log the follower counts.
2. **Enable Google Apps Script**: Open the script editor from the Extensions menu in Google Sheets.
3. **Paste the Script**: Copy the provided script into the script editor.
4. **Replace Placeholders**: Update the placeholders (e.g., `[FACEBOOK_API_KEY]`, `[SPREADSHEET_ID]`) with your actual API keys and spreadsheet ID.
5. **Set Up Triggers**: Create a time-driven trigger to run the script at your desired frequency (e.g., daily).
6. **Test the Script**: Run the script manually to ensure it works correctly and logs data to your spreadsheet.Web analytics with AI-powered insights and cross-platform tracking
Push notifications, in-app messaging, and email across channels
Automate your browser workflows effortlessly
Auto-transcribe meetings and generate action items
Free Accounting Software
A/B testing for physical stores
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan