YouTube Statistics Analyzer
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
YouTube Statistics is a project created to analyze YouTube videos and channels. This project can monitor the changes in views , likes, comments of a youtube video or new video uploads of a channel added to the database or the videos of the user uploads. This project is created in the purpose of automating the reseach work done around youtube statistics.
You can use this project freely and contribute to make it better
To get a local copy up and running follow these simple steps.
- Make of copy of the spreadsheet here. It already contains the Apps Script code from this repository.Make a copy of the sheet to your drive and use the copied version.
- Change the name of the Project to aything you want.
- From the spreadsheet, open the script editor by selecting Extensions > Apps Script.
- In the left-hand navigation pane, select + next to Services.
- Choose the YouTube Data API service, and click Add.
- Then Choose the Google Sheets API service, and click Add.
Clone the YouTube-Statistics
git clone https://github.com/HarshaAbeyvickrama/YouTube-Statistics.git
- From the script editor, navigate to the left-hand vertical toolbar, and choose Triggers.
- In the bottom right-hand corner, click the +Add Trigger button.
- Under Run, select the
updateVideoStatsTrigger
function. - Under Select event source, choose Time-driven.
- Under type, select Hour timer.
- Then select Every Hour. (This will run every hour of the day and update the view,like & comment count of videos)
- Optionally, adjust the Failure notification settings to configure how and when you are contacted by email if your triggered function fails.
- Click Save.
- Repeat from step 3 to 8 for the triggers
updateChannelVideoStatsTrigger
,updateUserChannelTrigger
&updateChannelsTrigger
. - For
updateUserChannelTrigger
&updateChannelsTrigger
use a weekly trigger.
addUserVideos()
: Add your uploads to the sheet to track.getUserVideos()
: Returns a JSON response of all user uploaded videos.addPublicVideo(url,type)
: Add a video with the link to the sheet to track.getPublicVideos()
: Returns a JSON response of all videos that are added to the sheet with addPublicVideo() functiongetVideoStats(videoID)
: Returns a JSON response of a particular video that is currently available in the databaseaddNewChannel(ChannelLink)
: Add a YouTube channel to the sheet to monitor. This function will add all videos in that channel to the database and it will monitor their views, comments & like count seperately.getChannel(channelID)
: Returns a JSON response with the details a particular channel
Here, a separate sheet will be created with the name of the video ID for every video added to the sheet. This is applicable for all user videos and addition of channels
resetDatabse()
: Reset the database by clearing all the records in the main sheets and deleting all the extra sheets created for channels.
If you get a CORS error in your console you can fix that by following the below steps
- Create a new folder anywhere you want
- Copy the absolute path of that newly created folder
- Replace the
path\to\your\folder
with the path you just copied inrunChrome.bat
file. - Then double click that
runChrome.bat
file and it will open a chrome window inweb security diabled
mode.There will a warning in the top of the browser. Just ignore that ☺ - You are good to go !
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Harsha Abeyvickrama - @VHAbeyvickrama - harshaabeyvickrama@gmail.com
Project Link: https://github.com/HarshaAbeyvickrama/YouTube-Statistics