-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b138e53
Showing
12 changed files
with
10,790 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
env: { | ||
commonjs: true, | ||
es2021: true, | ||
node: true, | ||
jest: true | ||
}, | ||
extends: [ | ||
'standard' | ||
], | ||
parserOptions: { | ||
ecmaVersion: 12 | ||
}, | ||
rules: { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# These are supported funding model platforms | ||
|
||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
|
||
custom: ['https://donate.reh.tw/', 'https://paypal.me/GoneTone'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: CD | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.operating-system }} | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
operating-system: [ ubuntu-latest ] | ||
node-version: [ 16.x ] | ||
|
||
name: NPM Publish | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Publish | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.operating-system }} | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
operating-system: [ ubuntu-latest ] | ||
node-version: [ 12.x, 14.x, 15.x, 16.x ] | ||
|
||
name: Node.js ${{ matrix.node-version }} Test on ${{ matrix.operating-system }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Run ESLint | ||
run: npm run lint | ||
|
||
- name: Jest Tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules/ | ||
/.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (C) 2021 by GoneTone | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Get YouTube ID By Url (Node.js Library) | ||
|
||
Get YouTube channel or video id by url! | ||
|
||
## Report Issues | ||
|
||
Please report any bugs you discover at <https://github.com/GoneToneStudio/node-get-youtube-id-by-url/issues> | ||
|
||
## Installation | ||
|
||
Node.js 12.0.0 or newer is required. | ||
|
||
### With NPM | ||
|
||
```sh-session | ||
npm install @gonetone/get-youtube-id-by-url | ||
``` | ||
|
||
## Examples | ||
|
||
```javascript | ||
const { channelId, videoId } = require('@gonetone/get-youtube-id-by-url') | ||
``` | ||
|
||
### Get YouTube Channel ID By Url | ||
|
||
```javascript | ||
channelId('YouTube Channel Url').then((id) => { | ||
console.log(id) | ||
}) | ||
``` | ||
|
||
Support URL format: | ||
|
||
- https://www.youtube.com/channel/xxxxxxxxxxxxxxxxxxxxxxxx | ||
- https://www.youtube.com/c/xxxxxxxx | ||
- https://www.youtube.com/user/xxxxxxxx | ||
|
||
### Get YouTube Video ID By Url | ||
|
||
```javascript | ||
videoId('YouTube Video Url').then((id) => { | ||
console.log(id) | ||
}) | ||
``` | ||
|
||
Support URL format: | ||
|
||
- https://www.youtube.com/watch?v=xxxxxxxxxxx | ||
- https://youtu.be/xxxxxxxxxxx | ||
|
||
## License | ||
|
||
[MIT](LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2014-2021 旋風之音 GoneTone | ||
* | ||
* Website: https://blog.reh.tw/ | ||
* GitHub: https://github.com/GoneTone | ||
* Facebook: https://www.facebook.com/GoneToneDY | ||
* Twitter: https://twitter.com/TPGoneTone | ||
* | ||
* Project GitHub: https://github.com/GoneToneStudio/node-get-youtube-id-by-url | ||
* | ||
* _oo0oo_ | ||
* o8888888o | ||
* 88" . "88 | ||
* (| -_- |) | ||
* 0\ = /0 | ||
* ___/`---'\___ | ||
* .' \\| |# '. | ||
* / \\||| : |||# \ | ||
* / _||||| -:- |||||- \ | ||
* | | \\\ - #/ | | | ||
* | \_| ''\---/'' |_/ | | ||
* \ .-\__ '-' ___/-. / | ||
* ___'. .' /--.--\ `. .'___ | ||
* ."" '< `.___\_<|>_/___.' >' "". | ||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | | ||
* \ \ `_. \_ __\ /__ _/ .-` / / | ||
* =====`-.____`.___ \_____/___.-`___.-'===== | ||
* `=---=' | ||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
* 佛祖保佑 永無 BUG | ||
*/ | ||
|
||
'use strict' | ||
|
||
const GetYouTubeIdByUrl = require('./src/GetYouTubeIdByUrl') | ||
|
||
module.exports = GetYouTubeIdByUrl |
Oops, something went wrong.