{"id":24013994,"url":"https://github.com/uchks/tf-observer","last_synced_at":"2025-04-15T09:43:32.909Z","repository":{"id":215737742,"uuid":"737494098","full_name":"uchks/tf-observer","owner":"uchks","description":"An open-source discord bot that tracks whenever an update is released to Discord's TestFlight and sends an embed. Made purely out of spite.","archived":false,"fork":false,"pushed_at":"2024-08-27T18:56:56.000Z","size":68,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T18:54:11.123Z","etag":null,"topics":["discord","discord-bot","testflight","testflight-api"],"latest_commit_sha":null,"homepage":"","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/uchks.png","metadata":{"files":{"readme":".github/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":"2023-12-31T08:48:52.000Z","updated_at":"2024-08-27T18:56:52.000Z","dependencies_parsed_at":"2024-01-10T06:43:29.139Z","dependency_job_id":"f6ef8172-180f-4654-93ce-8a422b505a6a","html_url":"https://github.com/uchks/tf-observer","commit_stats":null,"previous_names":["uchks/tf-observer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uchks%2Ftf-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uchks%2Ftf-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uchks%2Ftf-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uchks%2Ftf-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uchks","download_url":"https://codeload.github.com/uchks/tf-observer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249047372,"owners_count":21204241,"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":["discord","discord-bot","testflight","testflight-api"],"created_at":"2025-01-08T06:58:17.521Z","updated_at":"2025-04-15T09:43:32.886Z","avatar_url":"https://github.com/uchks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://unethicalcdn.com/enmity/tf-observer.png\" width=\"200\" height=\"200\" alt=\"tf-observer logo\" align=\"left\"/\u003e\u003cbr\u003e\n\u003cp align=\"left\"\u003e\n  \u003cstrong\u003etf-observer by uchks\u003c/strong\u003e\u003cbr\u003e\n  A discord bot that tracks whenever an update is released to Discord's TestFlight and sends an embed.\u003cbr\u003e\n\u003c/p\u003e\n\n\n\u003csub\u003eMade for \u003ca href=\"https://discord.gg/rMdzhWUaGT\"\u003eEnmity\u003c/a\u003e, a Discord client mod for iOS (and soon Android) devices.\u003cbr\u003e\nYou can view it in action in the \"testflight-updates\" channel, or \u003ca href=\"https://canary.discord.com/channels/950850315601711176/1190458226861416498\"\u003ehere\u003c/a\u003e.\u003c/sub\u003e\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n#### Build \u0026 Deployment:\n**Prerequisites:**\n- Node.js (https://nodejs.org/)\n\n**Setup:**  \u003c/br\u003e\n- **Clone the Repository:**  \u003c/br\u003e\n`git clone https://github.com/uchks/tf-observer.git`\n\n- **Navigate to the Repository:** \u003c/br\u003e\n`cd tf-observer`\n\n- **Install dependencies:** \u003c/br\u003e\n`npm install`\n\n- **Create a `.env` file:** \u003c/br\u003e\nIn the root of the repository, create a file named .env and add the following: \u003c/br\u003e\n```ts\nBOT_TOKEN = // your bots token.\nCHANNEL_ID = // channel id, must be a text or announcements channel.\nGUILD_ID = // server id\nCLIENT_ID = // discord developer portal, application's client id.\nFETCH_URL = // this is where the CloudFlare worker comes into place, see How It Happened.\nAPP_NAME = Discord - Chat, Talk \u0026 Hangout // Discord's app name.\nEMBED_COLOR = '' // the color for the embed\nEMBED_THUMBNAIL_URL = 'https://is3-ssl.mzstatic.com/image/thumb/Purple116/v4/fa/bf/43/fabf4352-a22e-4f88-796a-5e4bae0c4688/AppIcon-0-0-1x_U007epad-0-0-0-85-220.png/1920x1080bb-80.png' // Discord's app icon.\nDEV_MODE = false // true will reload commands on bot start every restart, false does not.\npostgresconn = // i used postgres for the database, adjust to your liking\n```\n\n- **Build \u0026 Run:** \u003c/br\u003e\n`npm run build`\n`npm run start`\n\n#### How It Happened:  \u003c/br\u003e\nDue to some unfavorable... _things_, I decided to look into Testflight's API. I did this by using my iPhone and my computer. Introducing: [mitmproxy](https://github.com/mitmproxy/mitmproxy), a glorious utility that allows you to proxy requests from your phone. it was quite simple really. \n- launch mitmproxy\n- find your local ipv4 address\n- change your phone wifi settings to the address with port 8080\n- go to https://mitm.it\n- install the root cert\n- enable the root cert\n- and open testflight \n\n![Requests](https://unethicalcdn.com/private/requests.png)\n\nSomething that stood out to me was the `/v3/accounts/` request. I clicked on it. In front of me were request headers, alongside the full link. I took note of this, figuring it'd be of use later on.\n![Request](https://unethicalcdn.com/private/request.png)\n\nTo the right of it, the response from the link.\n![Response](https://unethicalcdn.com/private/response.png)\n\nBelow it, is the JSON response body. At the top of it being Life360, an app I have in my Testflight. From there, I opened the response body in notepad, and searched for Discord. \n![Response Body](https://unethicalcdn.com/private/responsebody.png)\n\nThis is where I knew I found exactly what I wanted. So what did I do? Make things way more complicated than necessary, I created a Cloudflare Worker to make the request from the headers I got earlier for me, and filtered out the json data to _only_ show me the Discord portion. and from there, the rest is history. \n![Cloudflare Worker](https://unethicalcdn.com/private/cfworker.png)\n\nSo here's the source code. I don't expect anyone to read a book, but in the case you were interested, here it is. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuchks%2Ftf-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuchks%2Ftf-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuchks%2Ftf-observer/lists"}