{"id":21462063,"url":"https://github.com/intina47/comments_section_genie","last_synced_at":"2025-03-17T04:51:02.535Z","repository":{"id":240184787,"uuid":"801016240","full_name":"Intina47/comments_section_genie","owner":"Intina47","description":"This API retrieves comments from a YouTube video and performs sentiment analysis and question detection on each comment using the Google Cloud Natural Language API.","archived":false,"fork":false,"pushed_at":"2024-05-24T07:00:57.000Z","size":203,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"firebase-Functions","last_synced_at":"2025-01-23T14:32:34.868Z","etag":null,"topics":["firebase-functions","gcp","nlp-machine-learning"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Intina47.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-15T12:43:01.000Z","updated_at":"2024-06-03T18:12:49.000Z","dependencies_parsed_at":"2025-01-23T14:40:00.524Z","dependency_job_id":null,"html_url":"https://github.com/Intina47/comments_section_genie","commit_stats":null,"previous_names":["intina47/comments_section_genie"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intina47%2Fcomments_section_genie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intina47%2Fcomments_section_genie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intina47%2Fcomments_section_genie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intina47%2Fcomments_section_genie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intina47","download_url":"https://codeload.github.com/Intina47/comments_section_genie/tar.gz/refs/heads/firebase-Functions","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976503,"owners_count":20377692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase-functions","gcp","nlp-machine-learning"],"created_at":"2024-11-23T07:12:24.447Z","updated_at":"2025-03-17T04:51:02.506Z","avatar_url":"https://github.com/Intina47.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# comments_section-Genie\n# YouTube Comment Analysis API\n\nThis API retrieves comments from a YouTube video and performs sentiment analysis and question detection on each comment using the Google Cloud Natural Language API.\n\n## Setup\n\n1. Install the required dependencies:\n\n```bash\nnpm install firebase-functions @google-cloud/language axios dotenv he\n\n```\n\nEnable the YouTube Data API and the Google Cloud Natural Language API for your project in the Google Cloud Console.\n\nSet your YouTube Data API key in the Firebase functions configuration:\n\n```bash\nfirebase functions:config:set youtube.apikey=\"YOUR_API_KEY\"\n```\n\nSet the ``GOOGLE_APPLICATION_CREDENTIALS`` environment variable to the path of your Google Cloud service account key file.\n\n## Usage\nSend a GET request to the ``/getVideoComments`` endpoint with the videoUrl query parameter set to the URL of the YouTube video:\n\n```bash\nGET /getVideoComments?videoUrl=https://www.youtube.com/watch?v=dQw4w9WgXcQ\n```\n\nThe API will return a JSON array of objects, where each object has the following properties:\n- **comment:** The preprocessed comment text.\n- **sentiment:** The sentiment analysis result, which includes a score and a magnitude.\n- **isQuestion:** A boolean indicating whether the comment is a question.\n\n## Functions\n- **getComments(videoId, apiKey):** Retrieves comments for a YouTube video using the YouTube Data API.\n- **extractVideoId(url):** Extracts the video ID from a YouTube URL.\n- **preprocessComment(comment):** Preprocesses a comment by performing various transformations.\n- **analyzeSentiment(text):** Analyzes the sentiment of the given text.\n- **analyzeSyntax(text):** Analyzes the syntax of the given text and determines if it contains a question.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintina47%2Fcomments_section_genie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintina47%2Fcomments_section_genie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintina47%2Fcomments_section_genie/lists"}