Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
momentollogy committed Apr 13, 2023
1 parent 8c2c3ca commit cd3c622
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ <h1>Arduino Piano Buzzer Song Creator V1 <br> <small>by momentollogy</small><br>
try {
// Authenticate and load the Google Sheets API
await initClient();
await gapi.auth2.getAuthInstance().signIn();
// await gapi.auth2.getAuthInstance().signIn(); // Comment out this line

// Format song data for the Google Sheet
const songTitle = document.getElementById("song-title").value || "Untitled_Song";
Expand Down Expand Up @@ -682,6 +682,7 @@ <h1>Arduino Piano Buzzer Song Creator V1 <br> <small>by momentollogy</small><br>




async function loadSong() {
const songs = await fetchSongsFromSheet();
if (songs.length > 0) {
Expand All @@ -704,20 +705,18 @@ <h1>Arduino Piano Buzzer Song Creator V1 <br> <small>by momentollogy</small><br>

async function fetchSongsFromSheet() {
const sheetId = '1C9cqSvijRkJepxErd_jL0HQ4PCrjC0h7arOYj41DDOg';
const range = 'A:B';
const range = 'A:C';
const sheetsApi = 'https://sheets.googleapis.com/v4/spreadsheets';
const apiKey = 'AIzaSyA90ftyrgjmJPfzKeXYypzBdO9IJlbHU78';

const response = await fetch(`${sheetsApi}/${sheetId}/values/${range}?key=${apiKey}`, {
headers: {
'Authorization': 'Bearer ' + gapi.auth.getToken().access_token,
},
});

const response = await fetch(`${sheetsApi}/${sheetId}/values/${range}?key=${apiKey}`);
const result = await response.json();
return result.values || [];
}




function loadRecordedSong(notes) {
recordedNotes.length = 0;
recordedNotes.push(...notes);
Expand Down

0 comments on commit cd3c622

Please sign in to comment.