I don't see a way to export the contacts in Google Apps four Education directory via Google's older/newer layout of contacts.google.com. If there is no such option, Is there any way to extract all contacts displayed in that page by capturing the text data in that page so that I can at least get the required data in a text file?
Google-workspace – Extracting/Exporting contacts in GoogleApps for Education directory
exportgoogle-contactsgoogle-workspace
Related Solutions
Notice: While this answer is still completely accurate, now Google is phasing out Google Play Music in favor of YouTube Music. If you use their automatic converter, your playlists (including uploaded music) will be retained in YouTube Music. Unfortunately uploaded songs are not visible in shared playlists there either. So I made an equivalent script to the below for YouTube Music.
Modifying darkliquid's answer, I came up with the following which allows for multiple playlists to be saved at once.
Instructions:
- Go to Your Playlists page.
- Paste in the JavaScript code below into your console (press F12 to open your console).
- Click on a playlist that you want to save to text.
- Once on the playlist page, scroll to the bottom relatively slowly (so that each entry can be seen).
- After you've scrolled to the bottom, navigate back to the playlists page (same as in step 1.) using the menu or your browsers back button.
- Repeat steps 3-5 for all playlists you want to save to text.
- Once you've done this for all the playlists you want to save to text, you can either type
JSON.stringify(tracklistObj, null, '\t')
(change the'\t'
to' '
if you want minimal indentation) ortracklistObj
if you just want the JavaScript object to manipulate it your own way. If you want it sorted, run the commandObject.values(tracklistObj).forEach(a => a.sort())
before calling theJSON.stringify
command.
Be careful to not refresh the page before you've completed all that you want to do or else you'll have to restart from step 1.
// Setup
var tracklistObj = {},
currentPlaylist,
checkIntervalTime = 100,
lastTime;
// Process the visible tracks
function getVisibleTracks() {
var playlist = document.querySelectorAll('.song-table tr.song-row');
for(var i = 0; i < playlist.length ; i++) {
var l = playlist[i];
var title = l.querySelector('td[data-col="title"] .column-content');
if(title !== null)
title = title.textContent;
var artist = l.querySelector('td[data-col="artist"] .column-content');
if(artist !== null)
artist = artist.textContent;
var duration = l.querySelector('td[data-col="duration"] span');
if(duration !== null)
duration = duration.textContent;
var album = l.querySelector('td[data-col="album"] .column-content');
if(album !== null)
album = album.textContent;
var playCount = l.querySelector('td[data-col="play-count"] span');
if(playCount !== null)
playCount = playCount.textContent;
var rating = l.querySelector('td[data-col="rating"]');
if(rating !== null)
rating = rating.textContent;
// Add it if it doesn't exist already
if(tracklistObj[currentPlaylist] && !tracklistObj[currentPlaylist].includes(artist + " - " + title)) {
tracklistObj[currentPlaylist].push(artist + " - " + title);
if(printTracksToConsole) {
console.log(artist + ' - ' + title);
}
}
}
}
// Listen for page changes
window.onhashchange = function(e) {
currentPlaylist = null;
var doneLoading = setInterval(function() {
var playListName = document.querySelector('.gpm-detail-page-header h2[slot="title"]');
if(playListName != null) {
currentPlaylist = playListName.innerText;
if(tracklistObj[currentPlaylist] === undefined) {
tracklistObj[currentPlaylist] = [];
}
console.log("===================================");
console.log("Adding to playlist " + currentPlaylist);
getVisibleTracks();
clearInterval(doneLoading);
}
}, 100);
}
// Check for new tracks every so often
setInterval(function() {
getVisibleTracks();
}, checkIntervalTime);
// Whether or not to print the tracks obtained to the console
var printTracksToConsole = false;
You can also print out track names to the console as you go by changing printTracksToConsole
to true
(you should do this between steps 2 and 3).
Note that you can probably ignore all GET and POST errors in the console (these are generated by Play Music itself, not this script).
Also note that currently it's setup only to give Artist - Track name
, but you can easily edit the line that has tracklistObj[currentPlaylist].push(artist + " - " + title);
with album
, playCount
, duration
, or rating
, and/or whatever formatting you want (including CSV format if you so please). Do this before step 2.
Example output (all Google Play playlists I currently have) with default settings. It took about 5 minutes in total to navigate to each of the 32 playlists, scroll down them, and then convert the result to text.
P.S. You might be interested using a site I found called Tune My Music to make YouTube playlists (but YouTube restricts playlist creation to 10 a day) from the output so your friends can listen to your Google Playlists. If you do this, you probably want to use something like TextMechanic to remove the quotes and .mp3
from the outputted list.
Seems that when importing into Excel some of that information is being misplaced or lost.
Try to change the separator. Maybe some fields have the separator within, therefore confusing the importer.
Also, try to import section by section.
Best Answer
On the older Google Contacts
On the new Google Contacts
Add the contacts that you found in the Directory to My Contacts.