Advertisement
videobuddy

video seo score checher tool

Mar 19th, 2023
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>YouTube Videos SEO Score Checker</title>
  6. <style>
  7. * {
  8. box-sizing: border-box;
  9. margin: 0;
  10. padding: 0;
  11. }
  12.  
  13. body {
  14. font-family: Arial, sans-serif;
  15. background-color: #f2f2f2;
  16. color: #333;
  17. }
  18.  
  19. header {
  20. background-color: #4caf50;
  21. color: #fff;
  22. padding: 1em;
  23. text-align: center;
  24. }
  25.  
  26. h1 {
  27. font-size: 2em;
  28. margin: 0;
  29. }
  30.  
  31. main {
  32. max-width: 600px;
  33. margin: 0 auto;
  34. padding: 2em;
  35. }
  36.  
  37. .form-container {
  38. display: flex;
  39. flex-direction: column;
  40. justify-content: center;
  41. align-items: center;
  42. margin-bottom: 2em;
  43. }
  44.  
  45. label {
  46. font-size: 1.2em;
  47. margin-bottom: 0.5em;
  48. color: #4caf50;
  49. }
  50.  
  51. #video-url {
  52. width: 80%;
  53. font-size: 1.2em;
  54. padding: 0.5em;
  55. margin-bottom: 0.5em;
  56. border: 2px solid #4caf50;
  57. border-radius: 5px;
  58. }
  59.  
  60. #submit-btn {
  61. background-color: #4caf50;
  62. color: #fff;
  63. border: none;
  64. border-radius: 0.3em;
  65. font-size: 1.2em;
  66. padding: 0.5em 1em;
  67. cursor: pointer;
  68. transition: all 0.2s ease-in-out;
  69. }
  70.  
  71. #submit-btn:hover {
  72. background-color: #fff;
  73. color: #4caf50;
  74. border: 2px solid #4caf50;
  75. }
  76.  
  77. .result-container {
  78. display: flex;
  79. flex-direction: column;
  80. align-items: center;
  81. border: 2px solid #4caf50;
  82. padding: 2em;
  83. }
  84.  
  85. .score-container {
  86. text-align: center;
  87. margin-bottom: 2em;
  88. }
  89.  
  90. #score {
  91. font-size: 4em;
  92. font-weight: bold;
  93. color: #4caf50;
  94. margin: 0;
  95. }
  96.  
  97. .analysis-container {
  98. text
  99. </style>
  100. </head>
  101. <body>
  102. <header>
  103. <h1>YouTube Videos SEO Score Checker</h1>
  104. </header>
  105. <main>
  106. <div class="form-container">
  107. <label for="video-url">Enter YouTube Video URL:</label>
  108. <input type="text" id="video-url" placeholder="https://www.youtube.com/watch?v=..." />
  109. <button id="submit-btn">Check Score</button>
  110. </div>
  111. <div class="result-container">
  112. <div class="score-container">
  113. <h2>SEO Score:</h2>
  114. <p id="score">-</p>
  115. </div>
  116. <div class="analysis-container">
  117. <h2>SEO Analysis:</h2>
  118. <ul id="analysis-list">
  119. <li>-</li>
  120. <li>-</li>
  121. <li>-</li>
  122. <li>-</li>
  123. </ul>
  124. </div>
  125. </div>
  126. </main>
  127. <script>
  128. function checkSEO() {
  129. const videoURL = document.getElementById("video-url").value;
  130. const analysisList = document.getElementById("analysis-list");
  131.  
  132. // Validate YouTube Video URL
  133. const urlRegex =
  134. /^(https?\:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/.+$/;
  135. if (!urlRegex.test(videoURL)) {
  136. analysisList.innerHTML = "<li>Please enter a valid YouTube video URL.</li>";
  137. document.getElementById("score").textContent = "-";
  138. return;
  139. }
  140.  
  141. // Fetch YouTube API data
  142. const videoID = videoURL.match(/(?<=v=)[^&?]*/)[0];
  143. const apiURL = `https://www.googleapis.com/youtube/v3/videos?id=${videoID}&part=snippet,statistics&key=YOUR_API_KEY`;
  144. fetch(apiURL)
  145. .then((response) => response.json())
  146. .then((data) => {
  147. if (data.items.length === 0) {
  148. analysisList.innerHTML = "<li>The video ID is invalid or the video is not available.</li>";
  149. document.getElementById("score").textContent = "-";
  150. return;
  151. }
  152.  
  153. // Calculate SEO score
  154. const videoData = data.items[0];
  155. const videoTitle = videoData.snippet.title;
  156. const videoDescription = videoData.snippet.description;
  157. const videoTags = videoData.snippet.tags || [];
  158. const viewCount = videoData.statistics.viewCount;
  159. const likeCount = videoData.statistics.likeCount;
  160. const dislikeCount = videoData.statistics.dislikeCount;
  161. const commentCount = videoData.statistics.commentCount;
  162. const titleScore = calculateTitleScore(videoTitle);
  163. const
  164.  
  165. </script>
  166. </body>
  167. </html>
  168.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement