This file contains hidden or 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
/* | |
This script will take the URL parameters of your choice and save them to cookies during a user session, | |
so if a user changes pages on your site, the data will still be submitted with your forms. | |
Be sure to include the JS Cookie plugin https://github.com/js-cookie/js-cookie and jquery. | |
Add the code below to your website footer. | |
Adjust variable, parameter, and form input names accordingly, add or remove as necessary. | |
Note: some servers block files with 'cookie' in the name. Be sure to change the filename if you have problems loading the script. |
This file contains hidden or 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 | |
require_once($_SERVER['DOCUMENT_ROOT'].'/music/init.php'); | |
$albumCount = 0; | |
/* Get title and convert to date */ | |
$pageTitle = $parsehub['PageTitle']; | |
$timeString = str_replace("Week of ","",$pageTitle); |
This file contains hidden or 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
/* Get Artist */ | |
$stmt = $pdo->prepare('SELECT name FROM artist WHERE id = ?'); | |
$stmt->execute([$albumCurrent['artist_id']]); | |
$artist = $stmt->fetchColumn(); | |
$stmt = $pdo->prepare('SELECT itunes_url FROM artist WHERE id = ?'); | |
$stmt->execute([$albumCurrent['artist_id']]); | |
$itunesURL = $stmt->fetchColumn(); | |
$stmt = $pdo->prepare('SELECT allmusic_url FROM artist WHERE id = ?'); |
This file contains hidden or 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 | |
/* Get Styles */ | |
$stmt = $pdo->prepare('SELECT style_id FROM album_style WHERE album_id = ?'); | |
$stmt->execute([$albumCurrent['id']]); | |
$styles = $stmt->fetchAll(PDO::FETCH_COLUMN); | |
echo '<ul class="styles">'; | |
if (is_array($styles)) { |
This file contains hidden or 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
//Output from file_put_contents('postdata.php', $_POST); | |
completetGN8rVDxBWdtc65d4635be886e696a3194259d23052412017-03-24T20:19:[email protected]:20:18.717243{"loadJs": false, "sendEmail": true, "webhook": "https://________.com/music/get-status.php", "outputType": "json", "customProxies": "", "maxWorkers": "0", "startTemplate": "new_releases", "rotateIPs": false, "startValue": "{\"want\": [\"Indie Electronic\",\"Indie Folk\",\"Indie Pop\",\"Alternative Singer/Songwriter\",\"Neo-Psychedelia\"]}", "maxPages": "0", "startUrl": "http://www.allmusic.com/newreleases"}{"want": ["Indie Electronic","Indie Folk","Indie Pop","Alternative Singer/Songwriter","Neo-Psychedelia"]}new_releases14http://www.allmusic.com/newreleases | |
//Output from file_put_contents('postdata2.php', file_get_contents('php://input')); | |
status=complete&run_token=tEF14GZCoUAj&md5sum=a2fde4fa32e8460ada0b94572418d62a&data_ready=1&custom_proxies=&start_time=2017-03-24T23%3A48%3A08&owner_email=________%40gmail.com&is_empt |
This file contains hidden or 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
if ($itunes['resultCount'] != '0') { | |
$albumItunesURL = $itunes['results'][0]['collectionViewUrl'].'&ls=1&mt=1'; | |
$artistItunesURL = $itunes['results'][0]['artistViewUrl'].'&ls=1&mt=1'; | |
$albumItunesArt = $itunes['results'][0]['artworkUrl100']; | |
} else { | |
$albumItunesURL = 'NULL'; | |
$artistItunesURL = 'NULL'; | |
$albumItunesArt = 'NULL'; |
This file contains hidden or 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 | |
$json = include('getdata.php'); | |
$i=1; | |
/* create a dom document with encoding utf8 */ | |
//create a new xmlwriter object | |
$xml = new XMLWriter(); |
This file contains hidden or 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 | |
$json = include('getdata.php'); | |
echo $json->Albums[1]->Album; //test | |
/* create a dom document with encoding utf8 */ | |
//create a new xmlwriter object | |
$xml = new XMLWriter(); |
This file contains hidden or 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 | |
/* create a dom document with encoding utf8 */ | |
//create a new xmlwriter object | |
$xml = new XMLWriter(); | |
//using memory for string output | |
$xml->openMemory(); | |
//set the indentation to true (if false all the xml will be written on one line) | |
$xml->setIndent(true); | |
$xml->setIndentString("\t"); |
This file contains hidden or 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 | |
//for temporarily displaying raw XML on php page | |
header('Content-Type: text/xml'); | |
/* create a dom document with encoding utf8 */ | |
$doc = new DOMDocument('1.0', 'UTF-8'); | |
$doc->formatOutput = true; | |
$plist = $doc->createElement('plist'); |