{"id":25124452,"url":"https://github.com/seangsisg/trakttv-imdb-button","last_synced_at":"2026-04-30T01:35:03.759Z","repository":{"id":276369943,"uuid":"929088218","full_name":"seanGSISG/TraktTV-IMDB-Button","owner":"seanGSISG","description":"On IMDb pages, adds buttons to open Trakt and add the title to your list. On Google search pages, if the query starts with \"!m \" (movies) or \"!t \" (TV shows), adds buttons for Trakt search and adding the top result.","archived":false,"fork":false,"pushed_at":"2025-02-07T19:46:54.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T20:31:49.875Z","etag":null,"topics":["greasemonkey","imdb","tapermonkey","trakt-tv","violentmonkey"],"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/seanGSISG.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-07T19:34:22.000Z","updated_at":"2025-02-07T19:47:13.000Z","dependencies_parsed_at":"2025-02-07T20:31:52.117Z","dependency_job_id":"ed8ed033-0ee7-4d35-bc07-23b5d2ab3974","html_url":"https://github.com/seanGSISG/TraktTV-IMDB-Button","commit_stats":null,"previous_names":["seangsisg/trakttv-imdb-button"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanGSISG%2FTraktTV-IMDB-Button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanGSISG%2FTraktTV-IMDB-Button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanGSISG%2FTraktTV-IMDB-Button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seanGSISG%2FTraktTV-IMDB-Button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seanGSISG","download_url":"https://codeload.github.com/seanGSISG/TraktTV-IMDB-Button/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246863665,"owners_count":20846295,"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":["greasemonkey","imdb","tapermonkey","trakt-tv","violentmonkey"],"created_at":"2025-02-08T08:15:35.430Z","updated_at":"2026-04-30T01:35:03.717Z","avatar_url":"https://github.com/seanGSISG.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trakt.tv Buttons for IMDb and Google Search\n\nThis userscript adds Trakt.tv functionality to both IMDb and Google search pages. It is designed to work with popular userscript managers such as **Tampermonkey**, **Violentmonkey**, or **Greasemonkey**.\n\n- **On IMDb Title Pages:**  \n  Two buttons are added in the Genre section:\n  - **Open Trakt:** Opens the corresponding Trakt.tv page for the IMDb title.\n  - **Add to List:** Adds the title to your custom Trakt.tv list (by default, \"watchlist\").\n![image](https://github.com/user-attachments/assets/5d7cf0fd-90d4-4d3c-ac19-ed0c153014cb)\n\n- **On Google Search Pages:**  \n  When you search on Google and your query starts with a trigger:\n  - `!m ` indicates a movie search.\n  - `!t ` indicates a TV show search.\n  \n  The script then adds two buttons at the top of the search results:\n  - **Open Trakt Search:** Opens Trakt.tv’s search page for your query.\n  - **Add Top Result to List:** Searches Trakt for the top result and adds that movie or show to your custom list.\n![image](https://github.com/user-attachments/assets/a1b8d8d0-43d8-47d0-b4b2-84d7784ef916)\n\n## Installation\n\n1. **Install a Userscript Manager:**  \n   Make sure you have a userscript manager installed in your browser. Some popular options include:\n   - [Tampermonkey](https://www.tampermonkey.net/)\n   - [Violentmonkey](https://violentmonkey.github.io/)\n   - [Greasemonkey](https://www.greasespot.net/)\n\n2. **Install the Script:**  \n   - Go to the [GitHub repository](https://github.com/your-repo-link) for this script.\n   - Click the **\"Raw\"** button to view the raw version of the script.\n   - Your userscript manager should prompt you to install the script. Follow the instructions to complete the installation.\n\n## Configuration\n\nBefore using the script, you must obtain your own Trakt.tv credentials and configure the script with your information.\n\n### 1. Obtain Your Trakt.tv Credentials\n\n1. **Create or Log In to Your Trakt.tv Account:**  \n   Visit [Trakt.tv](https://trakt.tv/) and sign up or log in.\n\n2. **Register a New OAuth Application:**  \n   - Navigate to [Trakt.tv OAuth Applications](https://trakt.tv/oauth/applications).\n   - Click **Create New Application**.\n   - Fill in the application details:\n     - **Name:** (e.g., \"Tampermonkey Trakt Script\")\n     - **Redirect URI:**  \n       For device authentication, enter:\n       ```\n       urn:ietf:wg:oauth:2.0:oob\n       ```\n       (Place this on its own line, without any query strings.)\n     - **JavaScript (CORS) Origins:**  \n       If you plan to use a browser-based OAuth flow, add your website’s origin (e.g., `https://www.imdb.com`) on its own line. For device authentication, you can leave this blank.\n   - After submitting, you will see a **Client ID** and a **Client Secret**. **Keep these private.**\n\n3. **Obtain an Access Token via Device Authentication:**\n\n   - **Request a Device Code:**  \n     Use a tool like [Postman](https://www.postman.com/) or your browser’s developer console to make a POST request to:\n     ```\n     https://api.trakt.tv/oauth/device/code\n     ```\n     with the following JSON payload (replace `YOUR_CLIENT_ID`):\n     ```json\n     {\n       \"client_id\": \"YOUR_CLIENT_ID\"\n     }\n     ```\n     The response will include:\n     - `device_code`\n     - `user_code` (e.g., \"7162CF09\")\n     - `verification_url` (typically `https://trakt.tv/activate`)\n     - `expires_in` and `interval`\n\n   - **Authorize Your Application:**  \n     Open the `verification_url` in your browser and enter the `user_code` when prompted.\n\n   - **Poll for the Access Token:**  \n     After authorizing, make a POST request to:\n     ```\n     https://api.trakt.tv/oauth/device/token\n     ```\n     with the following payload (replace placeholders):\n     ```json\n     {\n       \"code\": \"YOUR_DEVICE_CODE\",\n       \"client_id\": \"YOUR_CLIENT_ID\",\n       \"client_secret\": \"YOUR_CLIENT_SECRET\",\n       \"grant_type\": \"urn:ietf:params:oauth:grant-type:device_code\"\n     }\n     ```\n     Poll this endpoint every few seconds (as specified by the `interval`) until you receive a response that includes an `access_token`.\n\n### 2. Configure the Script\n\nOpen the Tampermonkey script and replace the following placeholders in the configuration section:\n\n- `YOUR_CLIENT_ID` – with your Trakt.tv Client ID.\n- `YOUR_ACCESS_TOKEN` – with the access token you obtained.\n- `YOUR_USERNAME` – with your Trakt.tv username.\n\nFor example:\n```js\nconst TRAKT_CLIENT_ID = 'YOUR_CLIENT_ID';\nconst TRAKT_API_VERSION = 2;\nconst TRAKT_ACCESS_TOKEN = 'YOUR_ACCESS_TOKEN';\nconst TRAKT_USERNAME = 'YOUR_USERNAME';\nconst DEFAULT_LIST_SLUG = 'watchlist';\n```\n\n## Usage\n\n### On IMDb Pages:\nVisit an IMDb title page (e.g., [https://www.imdb.com/title/tt0110912/](https://www.imdb.com/title/tt0110912/)). Two buttons will appear in the Genre Chips section:\n- **Open Trakt:** Opens the corresponding Trakt.tv page.\n- **Add to List:** Adds the title (assumed to be a movie) to your custom list.\n\n### On Google Search Pages:\nWhen you perform a search on Google, include one of the triggers at the beginning of your query:\n- Use **!m** for movie searches (e.g., `!m Pulp Fiction`).\n- Use **!t** for TV show searches (e.g., `!t The Sopranos`).\n\nThe script will add two buttons at the top of the search results:\n- **Open Trakt Search:** Opens Trakt.tv’s search page with your query.\n- **Add Top Result to List:** Searches Trakt for the top result (movie or TV show based on the trigger) and adds it to your custom list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseangsisg%2Ftrakttv-imdb-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseangsisg%2Ftrakttv-imdb-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseangsisg%2Ftrakttv-imdb-button/lists"}