SHOW:
|
|
- or go back to the newest paste.
| 1 | $(eval | |
| 2 | const regex = /([0-9]+):([0-9]+):([0-9]+)/g; | |
| 3 | const time = "$(query)".match(regex); | |
| 4 | ||
| 5 | if (time === null) {
| |
| 6 | "Please enter a valid time in the format HH:MM:SS"; | |
| 7 | } else {
| |
| 8 | const seconds = (+time[0].split(':')[0]) * 60 * 60 + (+time[0].split(':')[1]) * 60 + (+time[0].split(':')[2]);
| |
| 9 | - | `$(urlfetch https://api.twitch.tv/helix/clips?broadcaster_id=$(channel)&has_delay=true&duration=${seconds}&started_at=${encodeURIComponent(moment.utc().subtract(seconds, 'seconds').format('YYYY-MM-DDTHH:mm:ss')+'Z')}&access_token=YOUR_ACCESS_TOKEN)`;
|
| 9 | + | `$(urlfetch https://https://www.twitch.tv/videos/1819919509)`; |
| 10 | } | |
| 11 | ) | |
| 12 |