ultimate-guitar
v1.0.5
Published
A scrape version of tabs.ultimate-guitar.com
Downloads
1,492
Maintainers
Readme
Tabs Ultimate Guitar
Ryann Kim Sesgundo
Disclaimer
I didn't own the entire code, which is actually came from Lester Navarra, the one who taught me how to scrape this website.
What's new!!!
- Added URL for random and first data
- Added all data
- Added get chords for customized URL
Sample code (First data gathered)
const UltimateGuitar = require("ultimate-guitar")
let do_it = async () => {
const guitar = new UltimateGuitar()
await guitar.init("your love") // Required for you to search a song
const data = await guitar.fetch_data(UltimateGuitar.FIRST)
console.log(data)
}
do_it()
Sample code (Random data gathered)
const UltimateGuitar = require("ultimate-guitar")
let do_it = async () => {
const guitar = new UltimateGuitar()
await guitar.init("your love") // Required for you to search a song
const data = await guitar.fetch_data(UltimateGuitar.RANDOM)
console.log(data)
}
do_it()
Output (Sample)
{
"title": "Song Title",
"artist": "Artist/Band name",
"key": "Sample Key",
"type": "Chords/Tabs",
"url": "Url Link",
"chords": "Chords Gathered"
}
Sample Code (All Data)
const UltimateGuitar = require("ultimate-guitar")
let do_it = async () => {
const guitar = new UltimateGuitar()
await guitar.init("your love") // Required for you to search a song
const data = await guitar.fetch_data()
console.log(data)
}
do_it()
Output (Sample)
{
"title": "Song Title",
"artist": "Artist/Band name",
"key": "Sample Key",
"type": "Chords/Tabs",
"url": "Url Link"
}
Sample Code (get_chords)
const UltimateGuitar = require("ultimate-guitar")
let do_it = async () => {
const data = await guitar.get_chords("https://tabs.ultimate-guitar.com/tab/i-belong-to-the-zoo/sana-chords-2405013")
console.log(data)
}
do_it()
Output (Success)
{
"song_name": "Song Name",
"artist_name": "Artist",
"type": "Chords, Tabs, Base or any related instrument",
"rating": 3.14,
"tonality_name": "Key",
"username": "The one who upload.",
"chords": "chords here"
}
Output (Error)
{
"error": "Error message"
}
Bugs and errors are still expected to this project, but still trying to improve it and make the error lesser or can handle by the program.
Credits
- Lester Navarra
- John Paul Caigas
- Mart Anthony Salazar
- Salvador
- Earl Shine Sawir
- John Jeremy Antiguo
- John Roy Lapida Calimlim
- Mark Kevin Manalo
- Freecodecamp
- Tutorialspoint
Additional details
The changes regarding to this package was suggested by Mr. Gem Rey Rañola, one of my colleagues in our local college.