{"id":17170274,"url":"https://github.com/alcadesign/twitchalerts","last_synced_at":"2025-03-24T19:22:11.508Z","repository":{"id":34066724,"uuid":"37854150","full_name":"AlcaDesign/TwitchAlerts","owner":"AlcaDesign","description":"Basic TwitchAlerts.com API module","archived":false,"fork":false,"pushed_at":"2019-02-28T05:52:37.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T23:43:47.788Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlcaDesign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-22T12:32:10.000Z","updated_at":"2019-05-07T12:19:24.000Z","dependencies_parsed_at":"2022-07-16T13:16:02.846Z","dependency_job_id":null,"html_url":"https://github.com/AlcaDesign/TwitchAlerts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlcaDesign%2FTwitchAlerts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlcaDesign%2FTwitchAlerts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlcaDesign%2FTwitchAlerts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlcaDesign%2FTwitchAlerts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlcaDesign","download_url":"https://codeload.github.com/AlcaDesign/TwitchAlerts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245334997,"owners_count":20598400,"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":"2024-10-14T23:29:20.733Z","updated_at":"2025-03-24T19:22:11.486Z","avatar_url":"https://github.com/AlcaDesign.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TwitchAlerts\n\nA basic, unofficial TwitchAlerts.com API Node.js module\n\n*Twitch is a trademark or registered trademark of Twitch Interactive, Inc. in the U.S. and/or other countries. \"TwitchAlerts\" is not operated by, sponsored by, or affiliated with Twitch Interactive, Inc. in any way.*\n\n*\"TwitchAlerts\" is not operated by, sponsored by, or affiliated with TwitchAlerts in any way*\n\n## Install\n\n```\n\t$ npm install --save AlcaDesign/TwitchAlerts\n```\n\n## Usage\n\nYou will require an API access token for every request to their API. [You can find the access token here.](https://www.twitchalerts.com/dashboard/api-settings)\n\n```javascript\n\n\tvar TwitchAlerts = require('twitchalerts'),\n\t\tta = new TwitchAlerts({ token: 'token_here' });\n\n```\n\n### Supported API Endpoints\n\n#### ta.getRecentDonations(options)\n\nGets the list of recent donators for the authenticated user.\n\nYou can pass extra querystring elements via the `options` argument as `qs`.\n\n##### Arguments\n\n1. options *(object)*: An object with elements to pass to the `request-promise` module.\n\n#### Returns\n\n*(Object)*: A bluebird promise.\n\n#### Example\n\n```javascript\n\t\n\tvar recDon = ta.getRecentDonations();\n\t\n\trecDon.then(function(data) {\n\t\t\tconsole.log(JSON.stringify(data, null, '\\t');\n\t\t\t/*\t{\n\t\t\t\t\t\"donations\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": 12345678,\n\t\t\t\t\t\t\t\"created_at\": \"2015-06-23T05:22:26Z\",\n\t\t\t\t\t\t\t\"amount\": 1,\n\t\t\t\t\t\t\t\"currency\": \"USD\",\n\t\t\t\t\t\t\t\"amount_label\": \"$1.00\",\n\t\t\t\t\t\t\t\"donator\": {\n\t\t\t\t\t\t\t\t\"id\": \"0a1b2c3d4e5f6g7h8i9j0k1l2m3o4p5q6r7s8t9u\",\n\t\t\t\t\t\t\t\t\"name\": \"TestUser1\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"message\": \"Hey, I appreciate your stream! Keep up the good work!\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"id\": 12345679\n\t\t\t\t\t\t\t\"created_at\": \"2015-06-23T05:25:09Z\",\n\t\t\t\t\t\t\t\"amount\": 12.5,\n\t\t\t\t\t\t\t\"currency\": \"USD\",\n\t\t\t\t\t\t\t\"amount_label\": \"$12.50\",\n\t\t\t\t\t\t\t\"donator\": {\n\t\t\t\t\t\t\t\t\"id\": \"a0b1c2d3e4f5g6h7i8j9k0l1m2n3o4p5q6r7s8t9\",\n\t\t\t\t\t\t\t\t\"name\": \"TestUser2\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"message\": \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t*/\n\t\t}).catch(function(err) {\n\t\t\t\tconsole.log(JSON.stringify(err.error, null, '\\t');\n\t\t\t\t/*\t{\n\t\t\t\t\t\t\"error\": \"Not found\",\n\t\t\t\t\t\t\"message\": \"User not found or invalid API key\"\n\t\t\t\t\t}\n\t\t\t\t*/\n\t\t\t});\n\t\n```\n\n### Not Yet Supported API Endpoints\n\n#### ta.getDonationGoal(options)\n\nGets the donation goal data for the authenticated user. In the response, you should get an object with a hash and the data pertaining to the donation goal widget. If you pass the hash in the querystring, you will get an array back until there is an update to the donation goal like: a donation was added, a donation was removed, etc. I can only get this to work in the browser from the donation widget due to Access-Control-Allow-Origin:\n\n```javasciprt\n\t\n\tvar access_token = 'access_token_here';\n\t$.ajax({\n\t\t\turl: 'http://www.twitchalerts.com/widgets/donation-goal',\n\t\t\tdata: {\n\t\t\t\t\ttoken: access_token,\n\t\t\t\t\tfilemtime: 1\n\t\t\t\t}\n\t\t}).success(function(data) { console.log(data) })\n\t\n```\n\nWith the jQuery ajax settings of `dataType` set to `jsonp` and `crossDomain` set to `true`, it returns the HTML for the page rather than the expected JSON.\n\nYou can pass extra querystring elements via the `options` argument as `qs`.\n\n##### Arguments\n\n1. options *(object)*: An object with elements to pass to the `request-promise` module.\n\n#### Returns\n\n*(Object)*: A bluebird promise.\n\n#### Example\n\n```javascript\n\t\n\tvar recDon = ta.getRecentDonations();\n\t\n\trecDon.then(function(data) {\n\t\t\tconsole.log(JSON.stringify(data, null, '\\t');\n\t\t\t/*\t{\n\t\t\t\t\t\"hash\": \"0a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p\",\n\t\t\t\t\t\"data\": {\n\t\t\t\t\t\t\"title\": \"Donation Goal Title\",\n\t\t\t\t\t\t\"percentComplete\": 22.88,\n\t\t\t\t\t\t\"goalCurrentAmount\": \"$183.00\",\n\t\t\t\t\t\t\"toGo\": \"89 days to go\",\n\t\t\t\t\t\t\"goalStart\": \"$0.00\",\n\t\t\t\t\t\t\"goalAmount\": \"$800.00\",\n\t\t\t\t\t\t\"settings\": {\n\t\t\t\t\t\t\t\"background_color\": \"#ffffff\",\n\t\t\t\t\t\t\t\"bar_color\": \"#B9A3E3\",\n\t\t\t\t\t\t\t\"bar_bg_color\": \"#6441A4\",\n\t\t\t\t\t\t\t\"text_color\": \"#FFFFFF\",\n\t\t\t\t\t\t\t\"bar_text_color\": \"#FFFFFF\",\n\t\t\t\t\t\t\t\"font\": \"Arial\",\n\t\t\t\t\t\t\t\"bar_thickness\": \"32\",\n\t\t\t\t\t\t\t\"layout\": \"condensed\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t*/\n\t\t}).catch(function(err) {\n\t\t\t\tconsole.log(JSON.stringify(err.error, null, '\\t');\n\t\t\t\t/*\t{\n\t\t\t\t\t\t\"error\": \"Not found\",\n\t\t\t\t\t\t\"message\": \"User not found or invalid API key\"\n\t\t\t\t\t}\n\t\t\t\t*/\n\t\t\t});\n\t\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falcadesign%2Ftwitchalerts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falcadesign%2Ftwitchalerts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falcadesign%2Ftwitchalerts/lists"}