{"id":26678228,"url":"https://github.com/telexintegrations/youtube-feeds-content","last_synced_at":"2025-03-26T05:15:15.396Z","repository":{"id":279059703,"uuid":"937375756","full_name":"telexintegrations/youtube-feeds-content","owner":"telexintegrations","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-23T14:16:53.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-23T14:32:52.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/telexintegrations.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":"2025-02-22T22:31:22.000Z","updated_at":"2025-02-23T14:16:56.000Z","dependencies_parsed_at":"2025-02-23T14:43:01.421Z","dependency_job_id":null,"html_url":"https://github.com/telexintegrations/youtube-feeds-content","commit_stats":null,"previous_names":["telexintegrations/youtube-feeds-content"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fyoutube-feeds-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fyoutube-feeds-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fyoutube-feeds-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fyoutube-feeds-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telexintegrations","download_url":"https://codeload.github.com/telexintegrations/youtube-feeds-content/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245591533,"owners_count":20640692,"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":[],"created_at":"2025-03-26T05:15:14.625Z","updated_at":"2025-03-26T05:15:15.375Z","avatar_url":"https://github.com/telexintegrations.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# YouTube Video Integration\r\nThis project integrates with the YouTube API to fetch the latest video from a specific channel. The integration involves fetching an XML feed from YouTube, parsing the XML to extract video details (such as title, author, and video link), and performing operations based on these details.\r\n\r\n## Features\r\n- Fetches the latest video from a specified YouTube channel.\r\n- Parses YouTube's XML feed to extract video details.\r\n- Sends video information to an external service (e.g., Telex) for further processing.\r\n- Error handling for network failures, empty feeds, or incorrect responses.\r\n## Tech Stack\r\n- Node.js - JavaScript runtime environment.\r\n- axios - Promise-based HTTP client for making API requests.\r\n- xml2js - XML to JSON parser for Node.js.\r\n- Jest - JavaScript testing framework used for unit and integration tests.\r\n## Installation\r\nPrerequisites\r\nEnsure you have `Node.js` installed on your machine. You can verify the installation by running:\r\n```bash\r\nnode --version \r\n ```\r\n## Steps to Set Up\r\n1. Clone the repository:\r\n```bash\r\ngit clone https://github.com/telexintegrations/youtube-feeds-content.git\r\n ```\r\n2. Navigate to the project directory:\r\n```bash\r\ncd hng-stage-3-telex-integration\r\n ```\r\n3. Install the dependencies:\r\n```bash\r\nnpm install\r\n ```\r\n4. Set the environment variables for the YouTube channel ID. Create a `.env`file in the root of the project and add the following:\r\n```bash\r\nYOUTUBE_CHANNEL_ID=your-youtube-channel-id\r\n```\r\n\r\n5. Run the application:\r\n```bash\r\nnpm start\r\n ```\r\n\r\n## Testing\r\nThe project uses Jest for unit testing.\r\nTo run tests:\r\n```bash\r\nnpm test\r\n ```\r\n\r\n## Endpoints\r\n- **URL**: `/api/telex/integration`\r\n- **Method**: `GET`\r\n- **Body**:No Body\r\n- **Response**\r\n```bash\r\n{\r\n    data: {\r\n        date: {\r\n            created_at: \"2025-02-20\",\r\n            updated_at: \"2025-02-20\",\r\n        },\r\n        descriptions: {\r\n            app_description: \"Get current youtube video from a creator channel.\",\r\n            app_logo:\r\n            \"https://img.freepik.com/free-photo/youtube-icon-line-connection-circuit-board_1379-892.jpg?semt=ais_hybrid\",\r\n            app_name: \"MyTube Feed.\",\r\n            app_url:\r\n            \"https://hng-stage-3-telex-integration-2.onrender.com/api/telex/integration\",\r\n            background_color: \"#fff\",\r\n        },\r\n        integration_category: \"Monitoring \u0026 Logging\",\r\n        integration_type: \"interval\",\r\n        is_active: true,\r\n        key_features: [\r\n            \"Fetches Latest youTube Channel Update.\",\r\n            \"Automated Weekly update.\",\r\n            \"Efficient Data Filtering.\",\r\n            \"Simple Design.\",\r\n        ],\r\n        settings: [\r\n            {\r\n            label: \"author\",\r\n            type: \"text\",\r\n            required: true,\r\n            default: \"authors name\",\r\n            },\r\n            {\r\n            label: \"title\",\r\n            type: \"text\",\r\n            required: true,\r\n            default: \"the title of the video\",\r\n            },\r\n            {\r\n            label: \"url\",\r\n            type: \"text\",\r\n            required: true,\r\n            default: \"link to the video\",\r\n            },\r\n            {\r\n            label: \"interval\",\r\n            type: \"text\",\r\n            required: true,\r\n            default: \"* * * * *\",\r\n            }\r\n        ],\r\n        tick_url:\r\n            \"https://hng-stage-3-telex-integration-2.onrender.com/api/telex/youtube/content/tick\",\r\n            target_url: \"\"\r\n        },\r\n    }\r\n ```\r\n- **URL**: `/api/telex/youtube/content/tick`\r\n- **Method**: `POST`\r\n- **Body**:\r\n```bash\r\n {\r\n              event_name: \"Youtube Video Update\",\r\n              message: \"telemessage\",\r\n              status: \"success\",\r\n              username: \"Youtube Monitor\"\r\n            }\r\n```\r\n- **Response**: \r\n```bash\r\n{\r\n    message: \"sent to telex\"\r\n}\r\n```\r\n**Response Image**: On  the telex  UI, the response look like:\r\n  ![alt text](\u003ctelexResponse.png\u003e)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Fyoutube-feeds-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelexintegrations%2Fyoutube-feeds-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Fyoutube-feeds-content/lists"}