{"id":26678259,"url":"https://github.com/telexintegrations/wit-what-is-trending","last_synced_at":"2025-09-03T18:34:46.750Z","repository":{"id":278974930,"uuid":"936974255","full_name":"telexintegrations/wit-what-is-trending","owner":"telexintegrations","description":"Pulls trending topics from across social media, ranging from tech news, crypto, gossip, politics, economy, education etc.","archived":false,"fork":false,"pushed_at":"2025-02-24T13:01:15.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-29T11:28:24.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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,"zenodo":null}},"created_at":"2025-02-22T03:27:58.000Z","updated_at":"2025-02-25T00:46:03.000Z","dependencies_parsed_at":"2025-02-22T23:20:22.165Z","dependency_job_id":"cc38a014-02b4-40a0-a6b8-6c8bc66f41f7","html_url":"https://github.com/telexintegrations/wit-what-is-trending","commit_stats":null,"previous_names":["telexintegrations/wit-what-is-trending-"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/telexintegrations/wit-what-is-trending","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fwit-what-is-trending","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fwit-what-is-trending/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fwit-what-is-trending/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fwit-what-is-trending/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telexintegrations","download_url":"https://codeload.github.com/telexintegrations/wit-what-is-trending/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2Fwit-what-is-trending/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273490530,"owners_count":25115166,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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:19.300Z","updated_at":"2025-09-03T18:34:46.728Z","avatar_url":"https://github.com/telexintegrations.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wit-what-is-trending?\n\n### **README for Telex Social Media Trend Tracker Integration**  \n\n---\n\n## **Telex Social Media Trend Tracker Integration**  \n\nThis integration fetches trending topics from social media platforms like Reddit and sends them to a designated Telex channel. Users can configure their preferred categories, and the integration dynamically pushes updates at scheduled intervals.  \n\n---\n\n## **Features**  \n\n✅ Fetches trending topics from Reddit (more platforms soon to be added).  \n✅ Allows users to set preferences for categories (e.g., politics, crypto, tech, gossip).  \n✅ Automatically pushes trending topics to a Telex channel.  \n✅ Configurable webhook for dynamic `channel_id`.  \n✅ Intelligent error handling and status reporting.  \n\n---\n\n## **Setup Instructions**  \n\n### **1. Prerequisites**  \n\nEnsure you have the following installed:  \n\n- **Node.js (v16 or later)**  \n- **TypeScript** (`npm install -g typescript`)  \n- **Express.js** (`npm install express`)  \n- **Axios** (`npm install axios`)  \n- **A Telex channel webhook URL**  \n\n### **2. Clone the Repository**  \n\n```sh\ngit clone https://github.com/telexintegrations/wit-what-is-trending-.git\ncd wit-what-is-trending-\n```\n\n### **3. Install Dependencies**  \n\n```sh\nnpm install\n```\n\n### **4. Configure Environment Variables**  \n\nCreate a `.env` file in the root directory and add your configurations:  \n\n```ini\nPORT=3000\nTELEX_WEBHOOK_URL=https://telex.im/api/v1/return\n```\n\n### **5. Start the Server**  \n\nRun the application:  \n\n```sh\nnpm run dev\n```\n\nOr compile and run:  \n\n```sh\nnpm run build\nnpm start\n```\n\n---\n\n## **Endpoints**  \n\n### **1. Get Social Media Trends**  \n\n- **URL:** `/trends`  \n- **Method:** `GET`  \n- **Description:** Fetches trending topics based on user preferences. If no preferences are set, returns general trends.  \n\n#### **Example Response**  \n\n```json\n{\n  \"trends\": {\n    \"politics\": [\n      {\n        \"title\": \"Election Updates\",\n        \"url\": \"https://www.reddit.com/r/politics/comments/12345\"\n      }\n    ],\n    \"crypto\": [],\n    \"tech\": []\n  }\n}\n```\n\n---\n\n### **2. Set User Preferences**  \n\n- **URL:** `/preferences`  \n- **Method:** `POST`  \n- **Description:** Stores user-selected categories for fetching trends.  \n\n#### **Request Body**  \n\n```json\n{\n  \"categories\": [\"politics\", \"crypto\", \"tech\"]\n}\n```\n\n#### **Example Response**  \n\n```json\n{\n  \"message\": \"Preferences saved successfully\"\n}\n```\n\n---\n\n### **3. Retrieve Telex Integration Configuration**  \n\n- **URL:** `/integration`  \n- **Method:** `GET`  \n- **Description:** Returns the configuration settings for Telex integration.  \n\n#### **Example Response**  \n\n```json\n{\n  \"interval\": \"every 10 minutes\",\n  \"webhook_base_url\": \"https://telex.im/api/v1\"\n}\n```\n\n---\n\n## **How It Works**  \n\n1. **Fetching Trends:**  \n   - The app calls the Reddit API to get trending topics in various categories.  \n   - If a user has preferences, only those categories are included.  \n   - If no preferences are set, all available trends are sent.  \n\n2. **Sending Data to Telex:**  \n   - Every time the `/trends` endpoint is hit, the latest trends are sent to Telex.  \n   - The integration reads the `channel_id` dynamically from the webhook URL.  \n\n3. **Scheduled Updates:**  \n   - The timing for sending trends is managed in `integration.json`.  \n   - Telex triggers the webhook at defined intervals.  \n\n---\n\n## **Screenshots**  \n\n### **1. Telex Channel Showing Trends Update**  \n![Telex Trend Update](https://your-image-url.com/trend-update.png)  \n\n### **2. Integration Configuration in Telex**  \n![Telex Integration](https://your-image-url.com/integration-config.png)  \n\n---\n\n## **Testing the Integration**  \n\nRun unit tests using Jest:  \n\n```sh\nnpm run test\n```\n\nCheck API responses with:  \n\n```sh\ncurl -X GET http://localhost:3000/trends\n```\n\n---\n\n## **Deployment**  \n\n### **1. Deploying on a Server**  \n\n1. Build the app:  \n\n   ```sh\n   npm run build\n   ```\n\n2. Start the production server:  \n\n   ```sh\n   npm start\n   ```\n\n### **2. Deploying on Docker**  \n\n```sh\ndocker build -t telex-trend-tracker .\ndocker run -d -p 3000:3000 telex-trend-tracker\n```\n\n---\n\n## **Troubleshooting**  \n\n| Issue | Solution |\n|--------|----------|\n| Trends return empty arrays | Check if categories have active trends. If not, the response will be empty. |\n| Webhook is not triggering | Ensure `integration.json` has the correct timing configuration. |\n| Axios fetch errors | Make sure API endpoints are accessible. |\n\n---\n\n## **Contributing**  \n\nFeel free to submit pull requests or open issues. Ensure you test all changes before submitting.  \n\n---\n\n## **License**  \n\nMIT License.  \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Fwit-what-is-trending","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelexintegrations%2Fwit-what-is-trending","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Fwit-what-is-trending/lists"}