mirror of
https://github.com/mudabbir-ahmad/Media-Aggregation-and-Sorting-System.git
synced 2026-10-07 19:40:20 +00:00
refactor: clean up comments and unused code in various files
This commit is contained in:
1 parent
9b20804f5a
commit
bb6bd0f4b3
28 files changed
+14
-392
No files matched your search
@@ -1,21 +1,3 @@
|
||||
// Google Photos Picker API Test
|
||||
//
|
||||
// Usage:
|
||||
// node TEST/testGooglePhotosAPI.js <ACCESS_TOKEN>
|
||||
// GOOGLE_ACCESS_TOKEN=ya29.xxx node TEST/testGooglePhotosAPI.js
|
||||
//
|
||||
// The token must have been granted the scope:
|
||||
// https://www.googleapis.com/auth/photospicker.mediaitems.readonly
|
||||
//
|
||||
// Getting a token from OAuth Playground (https://developers.google.com/oauthplayground):
|
||||
// 1. Click the gear icon → check "Use your own OAuth credentials"
|
||||
// 2. Enter your Client ID and Client Secret from Google Cloud Console
|
||||
// 3. In "Input your own scopes" enter:
|
||||
// https://www.googleapis.com/auth/photospicker.mediaitems.readonly
|
||||
// 4. Click "Authorize APIs" and sign in with your test Google account
|
||||
// 5. Click "Exchange authorization code for tokens"
|
||||
// 6. Copy the Access token (starts with ya29.) and pass it here
|
||||
|
||||
const PICKER_BASE = 'https://photospicker.googleapis.com/v1';
|
||||
const USERINFO_URL = 'https://www.googleapis.com/oauth2/v2/userinfo';
|
||||
|
||||
@@ -37,7 +19,6 @@ async function main() {
|
||||
|
||||
console.log('\n--- Google Photos Picker API Test ---\n');
|
||||
|
||||
// Test 1 — User info
|
||||
console.log('[1] Fetching user info...');
|
||||
try {
|
||||
const res = await fetch(USERINFO_URL, { headers });
|
||||
@@ -51,7 +32,6 @@ async function main() {
|
||||
console.log(` Failed: ${err.message}\n`);
|
||||
}
|
||||
|
||||
// Test 2 — Create Picker session
|
||||
console.log('[2] Creating Picker session...');
|
||||
let sessionId = null;
|
||||
try {
|
||||
@@ -68,7 +48,6 @@ async function main() {
|
||||
console.log(` Session created: ${sessionId}`);
|
||||
console.log(` mediaItemsSet: ${session.mediaItemsSet}\n`);
|
||||
|
||||
// Wait for session to be ready
|
||||
if (!session.mediaItemsSet) {
|
||||
console.log(' Waiting for session to become ready...');
|
||||
for (let i = 0; i < 10; i++) {
|
||||
@@ -87,7 +66,6 @@ async function main() {
|
||||
console.log(` Failed: ${err.message}\n`);
|
||||
}
|
||||
|
||||
// Test 3 — List media items from session
|
||||
if (sessionId) {
|
||||
console.log('[3] Fetching media items from session...');
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user