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
// Jeremie Miserez <[email protected]>, 2016 | |
// | |
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :) | |
// | |
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music | |
// | |
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist) | |
// | |
// 2. Open a developer console (F12 for Chrome). Paste | |
// code below into the console. |
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
// PHP snippet included in wp-config.php (or settings.php). | |
// Including from that location in a separate file is OK as well. | |
<?php | |
// Remove any leading "www." from the host name. | |
$redirect_host = str_replace('www.', '', $_SERVER['HTTP_HOST']); | |
$redirect_path = strtolower(rtrim($_SERVER['REQUEST_URI'])); | |
if (strlen($redirect_path) > 2) { | |
$redirect_path = rtrim($redirect_path, '/'); | |
} |