soundcloud-key-fetch
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -9,3 +9,3 @@ exports.fetchKey = async function() { | ||
res.forEach(urlA => { | ||
const urlreg = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/ | ||
const urlreg = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/ | ||
let url = urlA.replace('"></script>', ''); let res = url.split('\n')[0]; | ||
@@ -12,0 +12,0 @@ if(urlreg.test(res)) urls.push(res); |
@@ -37,3 +37,5 @@ { | ||
"soundcloud api key", | ||
"soundcloud key" | ||
"soundcloud key", | ||
"soundcloud token", | ||
"soundcloud api token" | ||
], | ||
@@ -46,3 +48,3 @@ "license": "ISC", | ||
}, | ||
"version": "1.0.7" | ||
"version": "1.0.8" | ||
} |
@@ -1,2 +0,3 @@ | ||
# Soundcloud Key Fetch | ||
# [soundcloud-key-fetch](https://www.npmjs.com/package/soundcloud-key-fetch) | ||
### *[soundcloud-key-fetch on GitLab](https://gitlab.com/syqwq/soundcloud-key-fetch)* | ||
A simple module to fetch a SoundCloud API key without owning an application, requiring no dependencies! | ||
@@ -13,6 +14,6 @@ ``` | ||
### sckey.fetchKey() | ||
- Returns a string conatining an API key that was scraped from SoundCloud. | ||
- Returns a string of an API token that was scraped from SoundCloud. ***Note:*** *This token contains no extra special privileges in the API, such as SoundCloud GO access; the token only provides the same amount of access as a user listening to SoundCloud without an account has.* | ||
### sckey.testKey(key) | ||
- Returns a boolean on whether or not the given key is valid. | ||
- Returns a boolean on whether or not the given key is valid. This function tests a given key against a SoundCloud API endpoint, and will verify it based on the response code given by the server. It will return "true" if the server responds with 404 or 200, "false" if the server responds with 401 or 403. | ||
@@ -28,3 +29,3 @@ ## Usage | ||
// await is also supported! | ||
// the function initially returns a promise, so you can either use the example above *or* you can call "await" like the example below. | ||
@@ -47,5 +48,5 @@ const key = await sckey.fetchKey(); | ||
// await is also supported! | ||
// the function initially returns a promise, so you can either use the example above *or* you can call "await" like the example below. | ||
const test = await sckey.testKey('SC-KEY'); | ||
``` |
6700
49