spotify-url-info
Advanced tools
Comparing version 2.2.1-0 to 2.2.1
@@ -5,2 +5,52 @@ # Changelog | ||
### 2.2.1-0 (2021-05-21) | ||
### [2.2.1](https://github.com/karlsander/spotify-url-info/compare/v2.2.1-0...v2.2.1) (2021-05-21) | ||
### Bug Fixes | ||
* coverage ([d4c3a62](https://github.com/karlsander/spotify-url-info/commit/d4c3a6237d751332d5ecbade0fd64381309571db)) | ||
### 2.2.0 | ||
- add `getTracks` feature (thanks [@DaliborTrampota](https://github.com/DaliborTrampota)!) | ||
### 2.1.0 | ||
Warning: The data returned from `getData` can change at any time. For example, the newer podcast embed does not provide `dominantColor` anymore. I do not consider that a breaking change for this library. The only guarantee is that you get the data spotify makes available. You need to add safety checks in your application code. Only the data shape returned by `getPreview` is guaranteed. | ||
- fixes an issue with encoded data in the parsed html page (issue #55) | ||
- add support for scraping a different type of embed page, currently used in podcast episodes (fixes issue #54) | ||
### 2.0.0 | ||
- Drop support for EOL node versions, which is technically breaking 🤷♂️ | ||
### 1.4.0 | ||
- Support for podcast episodes on spotify (contributed by @kikobeats) | ||
- new `description` and `date` fields in the preview object (contributed by @kikobeats) | ||
### 1.3.1 | ||
- update dependencies | ||
### 1.3.0 | ||
- remove lockfile | ||
### 1.2.0 | ||
- now uses Himalaya for html parsing instead of cheerio, its more complex / brittle but the bundle is way smaller so it can be used inside apps | ||
### 1.1.1 | ||
- generate embed url for preview with string concatination instead of using spotifyURL package | ||
- bump dependency versions | ||
### 1.1.0 | ||
- add embed field to `getPreview` result | ||
### 1.0.0 | ||
- first public release |
{ | ||
"name": "spotify-url-info", | ||
"description": "Get metadata for a spotify url without spotify API access", | ||
"description": "Get metadata from Spotify URLs", | ||
"homepage": "https://github.com/karlsander/spotify-url-info#readme", | ||
"version": "2.2.1-0", | ||
"version": "2.2.1", | ||
"main": "index.js", | ||
@@ -38,5 +38,7 @@ "author": { | ||
"embed", | ||
"link-preview", | ||
"metadata", | ||
"music", | ||
"spotify" | ||
"spotify", | ||
"spotify-urls" | ||
], | ||
@@ -75,3 +77,3 @@ "dependencies": { | ||
"contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls", | ||
"coverage": "nyc report --reporter=text-lcov | npx coveralls", | ||
"lint": "standard-markdown README.md && standard", | ||
@@ -88,3 +90,3 @@ "postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)", | ||
}, | ||
"license": "ISC", | ||
"license": "MIT", | ||
"commitlint": { | ||
@@ -91,0 +93,0 @@ "extends": [ |
@@ -1,12 +0,13 @@ | ||
# spotify-url-info | ||
<div align="center"> | ||
<img src="https://cdn.microlink.io/logo/banner.png" alt="microlink logo"> | ||
</div> | ||
[](https://www.npmjs.com/package/spotify-url-info) | ||
[](https://travis-ci.org/karlsander/spotify-url-info) | ||
 | ||
[](https://coveralls.io/github/microlinkhq/spotify.url-info) | ||
[](https://www.npmjs.org/package/spotify-url-info) | ||
This package can fetch useful metdata for spotify urls without needing a spotify API key. This is accomplished by some very light scraping. My usecase is providing a customized mini player preview. | ||
> Get metadata from Spotify URLs. | ||
**Warning:** This library will not work directly in the browser, because the spotify page that it scrapes does not allow cross-origion requests. You can use it in node.js, in serverless functions and in react native. Alternatively use a CORS proxy. | ||
## Install | ||
## Usage | ||
```bash | ||
@@ -16,2 +17,4 @@ npm install spotify-url-info | ||
## Usage | ||
```js | ||
@@ -21,4 +24,9 @@ const { getData, getPreview, getTracks } = require('spotify-url-info') | ||
There are two functions: getData provides the full available data, in a shape that is very similar to [what the spotify API returns](https://developer.spotify.com/documentation/web-api/reference/object-model/) and getPreview always returns the same fields for different types of resources (album, artist, playlist, track). The preview track is the first in the Album, Playlist, etc. Both take a spotify URL (play. or open.) as input and return a Promise. | ||
There are two functions: | ||
- `.getData`: Provides the full available data, in a shape that is very similar to [what the spotify API returns](https://developer.spotify.com/documentation/web-api/reference/object-model/). | ||
- `.getPreview`: Always returns the same fields for different types of resources (album, artist, playlist, track). The preview track is the first in the Album, Playlist, etc. | ||
Both take a spotify URL (play. or open.) as input and return a Promise. | ||
```js | ||
@@ -94,58 +102,7 @@ getPreview('https://open.spotify.com/track/5nTtCOCds6I0PHMNtqelas') | ||
## Caveats | ||
## License | ||
This uses cheerio to scrape the spotify twitter widget so it is unsanctioned and likely to break. I'll have the tests run on a schedule on travis ci so that I get notified when it will inevitably break. Then I can hopefully fix it. A more stable alternative is scraping the opengraph tags for the links with [open-graph-scraper](https://github.com/jshemas/openGraphScraper). The biggest issues there are no audio previews for artists and the number of requests it can take to get all the needed metadata. | ||
**spotify-url-info** © [microlink.io](https://microlink.io), released under the [MIT](https://github.com/microlinkhq/spotify-url-info/blob/master/LICENSE.md) License.<br> | ||
Authored by [Karl Sander](https://github.com/karlsander) and maintained by [Kiko Beats](https://kikobeats.com) with help from [contributors](https://github.com/microlinkhq/spotify-url-info/contributors). | ||
## Changelog | ||
### 2.2.0 | ||
- add `getTracks` feature (thanks [@DaliborTrampota](https://github.com/DaliborTrampota)!) | ||
### 2.1.0 | ||
Warning: The data returned from `getData` can change at any time. For example, the newer podcast embed does not provide `dominantColor` anymore. I do not consider that a breaking change for this library. The only guarantee is that you get the data spotify makes available. You need to add safety checks in your application code. Only the data shape returned by `getPreview` is guaranteed. | ||
- fixes an issue with encoded data in the parsed html page (issue #55) | ||
- add support for scraping a different type of embed page, currently used in podcast episodes (fixes issue #54) | ||
### 2.0.0 | ||
- Drop support for EOL node versions, which is technically breaking 🤷♂️ | ||
### 1.4.0 | ||
- Support for podcast episodes on spotify (contributed by @kikobeats) | ||
- new `description` and `date` fields in the preview object (contributed by @kikobeats) | ||
### 1.3.1 | ||
- update dependencies | ||
### 1.3.0 | ||
- remove lockfile | ||
### 1.2.0 | ||
- now uses Himalaya for html parsing instead of cheerio, its more complex / brittle but the bundle is way smaller so it can be used inside apps | ||
### 1.1.1 | ||
- generate embed url for preview with string concatination instead of using spotifyURL package | ||
- bump dependency versions | ||
### 1.1.0 | ||
- add embed field to `getPreview` result | ||
### 1.0.0 | ||
- first public release | ||
```` | ||
``` | ||
``` | ||
```` | ||
> [microlink.io](https://microlink.io) · GitHub [microlink.io](https://github.com/microlinkhq) · Twitter [@microlinkhq](https://twitter.com/microlinkhq) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14109
5
0
1
106