function arcmaj3_handler() { #do things... if (Rq('amtask') == 'up') { echo 'Uploaded barrel received.'; #Client has finished a barrel. Parse new URL list provided and add to URLs table. Mark barrel's original URLs as completed, excluding URLs that ran into problems. Mark barrel as finished. #For now, all that will be provided here is an Internet Archive identifier. #Check for duplicates. Add new unique URLs matching intake criteria (matching an existing project) to URLs table. // $ulBarrel = file_get_contents($_FILES['uploadedBarrelData']['tmp_name']); // $ulFailed = file_get_contents($_FILES['failedUrlData']['tmp_name']); $ulBarrel = preg_replace('/[\\n]+/', "\n", str_replace('\\nhttp://http://', 'http://', base64_decode(Rq('uploadedBarrelData')))); echo 'ulBarrel:' . "\n\n"; //print_r($ulBarrel); echo "\n\n"; echo "\n\n"; $ulFailed = preg_replace('/[\\n]+/', "\n", base64_decode(Rq('failedUrlData'))); $ulBarrel = str_replace("\r", "\n", $ulBarrel); $ulFailed = str_replace("\r", "\n", $ulFailed); $barrelData = explode("\n", $ulBarrel); print_r($barrelData); echo "\n\n"; $failedData = explode("\n", $ulFailed); print_r($failedData); $barrelId = $barrelData[0]; $barrelUserName = $barrelData[1]; $db = new FractureDB('arcmaj3'); $urlsFinished = $db->getRows('am_urls', 'barrel', $barrelId); #Set status to 1. Set who to $barrelUserName. $db->setField('am_barrels', 'status', 1, $barrelId); $db->setField('am_barrels', 'who', $barrelUserName, $barrelId); foreach ($barrelData as $value) { #Add URL to URL list. $potentialProject = get_domain_simple($value); $projects = $db->getRow('am_projects', 'urlPattern', $potentialProject); $projectId = $projects['id']; #$projectId=1; if (strlen($projects['id']) !== 0) { $newUrlId = $db->addRow('am_urls', 'location, project, locationHashUnique', "'" . $value . "', '" . $projectId . "', '" . hash('sha512', $value) . "'"); } } foreach ($urlsFinished as $value) { #Set completed to true. $db->setField('am_urls', 'completed', 1, $value); } foreach ($failedData as $value) { #TODO: Increment failedAttempts, set completed to false, set barrel to 0 $potentialProject = get_domain_simple($value); $projects = $db->getRow('am_projects', 'urlPattern', $potentialProject); $projectId = $projects['id']; $db->addRow('am_urls', 'location, project, locationHashUnique', "'" . $value . "', '" . $projectId . "', '" . hash('sha512', $value) . "'"); $failedRowIdRecord = $db->getRow('am_urls', 'location', $value); $failedRowId = $failedRowIdRecord['id']; echo "\n\nWorking with failed row {$value}, ID {$failedRowId}"; $currentFailed = $db->getField('am_urls', 'failedAttempts', $failedRowId); $currentFailed++; $db->setField('am_urls', 'failedAttempts', $currentFailed, $failedRowId); $db->setField('am_urls', 'completed', 0, $failedRowId); $db->setField('am_urls', 'barrel', 0, $failedRowId); } } else { if (Rq('amtask') == 'down') { #Client wants a barrel. Compile random URLs from the URL table of unfinished URLs and create a barrel. Mark the URLs as taken. Add barrel to barrels table. #For now, choose an uncompleted URL from the table, and send it. #Number of URLs per bucket: $urlsPerBucket = 50; #Barrel format 0.1: #ID,0xURL\n $db = new FractureDB('arcmaj3'); #Make a new barrel. $newBarrelId = $db->addRow('am_barrels', 'status, who, dateAssigned', "'0', '" . Rq('userName') . "', '" . date('Y') . "-" . date('m') . "-" . date('d') . "'"); echo $newBarrelId . "\n"; $urlCounter = 0; while ($urlCounter < $urlsPerBucket) { $rowToReturn = $db->getRandomRow('am_urls', 'barrel', '0'); $db->setField('am_urls', 'barrel', $newBarrelId, $rowToReturn['id']); #echo $rowToReturn['id'].','.$rowToReturn['location']; #Barrel format 0.11: #0xURL\n echo $rowToReturn['location'] . "\n"; $urlCounter++; } // echo "http://drive.google.com/\n"; // echo "http://wretch.cc/\n"; // echo "http://example.com/\n"; // echo "http://comments.gmane.org/gmane.mail.squirrelmail.plugins/9672\n"; // echo "http://futuramerlin.com\n"; // echo "http://archive.org\n"; // echo "https://archive.org\n"; } else { if (Rq('amtask') == 'expireBarrel') { $db = new FractureDB('arcmaj3'); $barrelId = Rq('barrelId'); $db->updateColumn('am_urls', 'barrel', '0', 'barrel', $barrelId); $db->setField('am_barrels', 'status', '2', $barrelId); echo 'Expired barrel ' . $barrelId . '.'; } else { echo 'Unrecognized operation'; } } } }
function discography() { $main = new FluidActive('discography', 'Releases'); $main->append('<div style="background-color:#FFFFFF;text-align:left;left:0px;top:0px;bottom:0px;right:0px;padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;position:fixed;overflow-x:scroll;overflow-y:scroll;z-index:1998;"> '); //$main->append('<!-- <div style="z-index:2001;left:10px;position:fixed;top:10px;background:#F954A2;"><b>what</b>: What the event/project is. <b>begin</b>: When it begins. <b>end</b>: When it ends or is due. <b>location</b>: Where it happens. <b>notes</b>: e.g. assignment details.</div> -->'); //print('what: What the event/project is. begin: When it begins. end: When it ends or is due. location: Where it happens. notes: e.g. assignment details.'); $db = new FractureDB('futuqiur_calendarsync'); if ($_REQUEST["action"] == "releases") { $intro = <<<'EOD' <h1>Releases</h1> Notes:<br> <ol> <li>The horizontal lines between blocks of releases indicate major changes in style/ability etc.</li> <li>Sometimes, italicization of an attribute of an item (<span style="font-style: italic;">i. e.</span>, one of the comments regarding a list entry) has been used to distinguish items within the list in which italicization holds some form of semantic meaning, or in which for some reason italicization would be undesirable.</li> <li>This list uses Unicode to display its content, and assumes that support for its characters is fairly complete in your computer.</li> <li>This list assumes the presence of the following specialty typefaces in your computer for displaying text in Anoé (<small><span style="font-family: AnoeyFuturamerlincom;">anoé</span></small>/<small><small><small><span style="font-family: AnoeyTuinelanFuturamerlincom;">anoé</span></small></small></small>) and Japanese, and for displaying other unusual characters:</li> <ul> <li><a href="http://futuramerlin.com/d/s/typefaces/AnoeyFuturamerlincom2.61.ttf">AnoeyFuturamerlincom</a> (version 2.61 or later)<br> </li> <li><a href="http://futuramerlin.com/d/s/typefaces/AnoeyTuinelanFuturamerlincom1.1.ttf">AnoeyTuinelanFuturamerlincom</a> (version 1.1 or later)</li> </ul> <li>In addition, the following Wreathe typeface family might be useful, with the useful components in bold (the rest are provided for completeness) — using these typefaces will provide rudimentary support for all of Unicode with the exceptions of Kaithi, Sora Sompeng, Chakma, Sharada, Miao, and mathematical symbols for Arabic:</li> <ul> <li><a style="font-weight: bold;" href="http://futuramerlin.com/d/s/typefaces/WreatheR.ttf">Wreathe</a> (version 2.6F provided) (the main typeface) and its variants:<br> </li> <ul> <li><a style="font-weight: bold;" href="http://futuramerlin.com/d/s/typefaces/WreatheI.ttf">Wreathe Italic</a> (version 2.0G provided) (Italic)</li> </ul> <ul> <li><a style="font-weight: bold;" href="http://futuramerlin.com/d/s/typefaces/WreatheBoldItal.ttf">Wreathe Bold Italic</a> (version 1 provided) (Bold Italic)</li> </ul> <ul> <li><a href="http://futuramerlin.com/d/s/typefaces/WreatheM.ttf">WreatheM</a> (version 1 provided) (A variant of the Roman style)</li> </ul> <ul> <li><a href="http://futuramerlin.com/d/s/typefaces/WreatheDecorative1.11.ttf">Wreathe Decorative</a> (version 1.11 provided) (A decorative version)</li> </ul> <ul> <li><a href="http://futuramerlin.com/d/s/typefaces/WreatheSC.ttf">Wreathe SC</a> (version 1 provided) (Small capitals)</li> </ul> <li><a style="font-weight: bold;" href="http://futuramerlin.com/d/s/typefaces/WreatheUnicode3.14.2.1.ttf">Wreathe Unicode</a> (version 3.14.2.1 provided) (a pan-Unicode typeface)</li> <li><a style="font-weight: bold;" href="http://futuramerlin.com/d/s/typefaces/WreatheHanAJP1.0.ttf">Wreathe Han A JP</a> (version 1.0 provided) (a Han Unicode typeface)</li> <li><a style="font-weight: bold;" href="http://futuramerlin.com/d/s/typefaces/WreatheHanBJP1.0.ttf">Wreathe Han B JP</a> (version 1.0 provided) (a Han Unicode typeface)</li> </ul> <li>Many of the computer files provided herein are in proprietary formats that may prove challenging to open. At some point I plan to provide all the files reëncoded using the Free Lossless Audio Codec, but I have not yet done that.</li> <li>The years of composition on some of the track listings shown in the artwork are often approximate.</li> <li>Unless otherwise noted, the first image in the album artwork is the cover.</li> <li>Unless otherwise noted, each piece was composed, performed, and produced by Elliot Chandler Wallace.</li> <li>How catalogue numbers work: The "Original series" catalogue numbers are the numbers assigned by the data HTML file corresponding to the release. The "New series" catalogue numbers are numbers assigned by artist, in the format <span style="font-style: italic;">x</span>-<span style="font-style: italic;">n</span>, where <span style="font-style: italic;">x</span> is the artist ID, and <span style="font-style: italic;">n</span> is the release ID (a rough estimate of the chronological order of the releases was used to establish the ordering of release IDs). For example, Futuramerlin.com is artist 6, so the first release under that artist name, the 17-track edition of Sylvan Fantasy, has the new series number 6-1. The "ID" is the new (assignments begun 8 October 2012) release numbering system, designed to not conflict with either earlier system. <br> </li> <li>Key:</li> <ol> <li>Availability:</li> <ol> <li>✓ = This release is now available</li> </ol> <li>Audio:</li> <ol> <li>(👂) = lossy, low quality, or partial CD/DVD/cassette rips or audio files provided<br> </li> <li>👂 = complete lossless audio or archival quality CD/DVD/cassette rips provided</li> </ol> <li>Source audio files:</li> <ol> <li>(🎧) = low quality or partial source audio files provided</li> <li>🎧 = complete source audio files provided<br> </li> </ol> <li>Artwork:</li> <ol> <li>(ðŸ‘) = lossy, poor-quality, or partial artwork provided</li> <li> 👠= complete lossless artwork provided (including, for digital media, any artwork embedded in the release data)<br> </li> </ol> <li>Artwork scans:</li> <ol> <li>(📷) = lossy, low quality, or partial artwork scans provided</li> <li>📷 = complete archival quality artwork scans provided</li> </ol> <li>Source artwork files:</li> <ol> <li>(📄) = low quality or partial source artwork files provided</li> <li>📄 = complete source artwork files (including media artwork source files) provided</li> </ol> <li>Media images:</li> <ol> <li>(💿) = lossy, low quality, or partial media images (scans or photographs) provided</li> <li>💿 = complete archival quality media images (scans or photographs) provided</li> </ol> <li>Video:</li> <ol> <li>(🎥) = lossy, low quality, or partial video files provided</li> <li>🎥 = complete archival quality video files provided</li> </ol> <li>Source video files:</li> <ol> <li>(🎬) = low quality or partial source video files provided</li> <li>🎬 = complete archival quality source video files provided</li> </ol> <li>ZIP files</li> <ol> <li>ZIP = ZIP files provided (only for digital releases originally released as ZIP files)</li> </ol> <li>CD images</li> <ol> <li>DD = CD or other media images (binary copies) provided<br> </li> </ol> </ol> </ol> <br> Í <br> EOD; $main->append($intro); $releases = $db->getOrderedRows('releases', 'indexdate DESC, fineindex DESC'); print_r($releases); $main->append('<ul>'); foreach ($releases as $key => $value) { if (strlen($value['title']) > 0) { $title = hex2bin($value['title']); } else { $title = "(link)"; } if (strlen($value['annotation']) > 0) { $annotation = ' (' . hex2bin($value['annotation']) . ') '; } else { $annotation = ""; } if (strlen($value['date']) > 0) { $date = ' (' . hex2bin($value['date']) . ') '; } else { $date = ""; } if ($value['medium'] > 0) { $medium = ' (' . hex2bin($db->getField('medium', 'name', $value['medium'])); if ($value['mediumquestioned'] == 1) { $medium = $medium . '?) '; } else { $medium = $medium . ') '; } } else { $medium = ""; } if ($value['va'] == 1) { $artist = 'multiple primary artists credited'; } else { if (strlen($value['artist'] > 0)) { $artist = '<i>as </i><a href="/d/r/active.php?wint=1&wintNeeded=discography&action=artist&artistid=' . $value['artist'] . '">' . hex2bin($db->getField('artist', 'name', $value['artist'])) . '</a>'; } else { if ($value['uncredited'] == 1) { $artist = '<i>no primary artist credited</i>'; } else { $artist = "<i>artist credit unknown</i>"; } } } $main->append('<li><a href="/d/r/active.php?wint=1&wintNeeded=discography&action=release&relid=' . $value['id'] . '">' . $title . '</a>' . $annotation . $date . $medium . '<i>(</i>' . $artist . '<i>)</i></li>'); if ($value['innovation'] == 1) { $main->append('<hr>'); } } $main->append('</ul>'); } //$music = $db->getTable('music'); //$main->append('<!-- <div style="z-index:2001;left:10px;position:fixed;top:10px;background:#F954A2;"><b>what</b>: What the event/project is. <b>begin</b>: When it begins. <b>end</b>: When it ends or is due. <b>location</b>: Where it happens. <b>notes</b>: e.g. assignment details.</div> -->'); //$main->append('</script>'); // $main->DBTableEntry($db, 'releases'); // $main->DBTableEntry($db, 'works'); // $main->DBTableEntry($db, 'versions'); // $main->DBTableEntry($db, 'artist'); // $main->DBTableEntry($db, 'label'); //$main->append('<script type="text/javascript">'); $main->close(); }
function arcmaj3_handler() { #verd: Arcmaj3 protocol version ID #echo Rq('verd'); if (Rq('verd') == '2') { #do things... if (Rq('amtask') == 'up') { echo 'Uploaded barrel notification received.'; #Client has finished a barrel. Parse new URL list provided and add to URLs table. Mark barrel's original URLs as completed, excluding URLs that ran into problems. Mark barrel as finished. #For now, all that will be provided here is an Internet Archive identifier. #Check for duplicates. Add new unique URLs matching intake criteria (matching an existing project) to URLs table. // $ulBarrel = file_get_contents($_FILES['uploadedBarrelData']['tmp_name']); // $ulFailed = file_get_contents($_FILES['failedUrlData']['tmp_name']); $BarrelUrlListLoc = 'https://archive.org/download/' . Rq('amloc') . '/' . 'URLs.lst'; $uBarrelData = get_url($BarrelUrlListLoc); #echo $uBarrelData; echo "\n\n" . 'List data URL: ' . $BarrelUrlListLoc; $BarrelFailedListLoc = 'https://archive.org/download/' . Rq('amloc') . '/' . 'failed.lst'; $uBarrelFailed = get_url($BarrelFailedListLoc); #echo gzdecode($uBarrelFailed); echo "\n\n" . 'Failed entry data URL: ' . $BarrelFailedListLoc . "\n\n"; #echo "Decoding barrel data...\n"; $ulBarrel = preg_replace('/[\\n]+/', "\n", str_replace('\\nhttp://http://', 'http://', gzdecode($uBarrelData))); echo 'ulBarrel:' . "\n\n"; //print_r($ulBarrel); echo "\n\n"; echo "\n\n"; #echo "Decoding failed URL data...\n"; $ulFailed = preg_replace('/[\\n]+/', "\n", gzdecode($uBarrelFailed)); $ulBarrel = str_replace("\r", "\n", $ulBarrel); $ulFailed = str_replace("\r", "\n", $ulFailed); $barrelData = explode("\n", $ulBarrel); print_r($barrelData); echo "\n\n"; $failedData = explode("\n", $ulFailed); print_r($failedData); $barrelId = $barrelData[0]; $barrelUserName = $barrelData[1]; $db = new FractureDB('futuqiur_arcmaj3'); $urlsFinished = $db->getRows('am_urls', 'barrel', $barrelId); $urlsFinished = $urlsFinished[0]; $barrelSize = Rq('barrelSize'); #Set status to 1. Set who to $barrelUserName. $db->setField('am_barrels', 'who', $barrelUserName, $barrelId); $db->setField('am_barrels', 'size', $barrelSize, $barrelId); foreach ($barrelData as $value) { #Add URL to URL list. $pps = $db->getColumn('am_projects', 'urlPattern'); $testProjects = False; $potentialProject = ''; //$pp=fuzzyMatchGetRow('am_projects','projectId','urlPattern','',$limit='')['projectId']; //print_r($pps); foreach ($pps as $ppid) { if (stripos($value, $ppid['urlPattern']) !== false) { $testProjects = True; $potentialProject = $ppid['urlPattern']; } } #$potentialProject = get_domain_simple($value); $projects = $db->getRow('am_projects', 'urlPattern', $potentialProject); $projectId = $projects['id']; #$projectId=1; if ($testProjects) { $newUrlId = $db->addRowFuzzy('am_urls', 'location, project, locationHashUnique', "'" . $db->UrlEscS($value) . "', '" . $projectId . "', '" . hash('sha512', $db->UrlEscS($value)) . "'"); } // echo "<br>\n"; // echo 'Added/updated row '; // echo $newUrlId; // echo ', URL '; // echo $value; // echo "<br>\n"; } // foreach ($urlsFinished as $value) { // #Set completed to true. // $db->setField('am_urls', 'completed', 1, $value); // } foreach ($failedData as $value) { #TODO: Increment failedAttempts, set completed to false, set barrel to 0 $pps = $db->getColumn('am_projects', 'urlPattern'); $testProjects = False; $potentialProject = ''; //$pp=fuzzyMatchGetRow('am_projects','projectId','urlPattern','',$limit='')['projectId']; //print_r($pps); foreach ($pps as $ppid) { if (stripos($value, $ppid['urlPattern']) !== false) { $testProjects = True; $potentialProject = $ppid['urlPattern']; } } #$potentialProject = get_domain_simple($value); $projects = $db->getRow('am_projects', 'urlPattern', $potentialProject); $projectId = $projects['id']; $db->addRowFuzzy('am_urls', 'location, project, locationHashUnique', "'" . $db->UrlEscS($value) . "', '" . $projectId . "', '" . hash('sha512', $db->UrlEscS($value)) . "'"); $failedRowIdRecord = $db->getRow('am_urls', 'location', $db->UrlEscS($value)); $failedRowId = $failedRowIdRecord['id']; echo "\n\nWorking with failed row {$value}, ID {$failedRowId}"; $currentFailed = $db->getField('am_urls', 'failedAttempts', $failedRowId); $currentFailed++; $db->setField('am_urls', 'failedAttempts', $currentFailed, $failedRowId); $db->setField('am_urls', 'completed', 0, $failedRowId); #Permanently fail URLs that have failed 100 times. if ($failedRowIdRecord['failedAttempts'] < 100) { $db->setField('am_urls', 'barrel', 0, $failedRowId); } } $db->setField('am_barrels', 'status', 1, $barrelId); $db->close(); if (count($barrelData) < 2) { echo 'Barrel upload failed. Expiring barrel ' . $barrelId . '…'; #The barrel data array should always have at least two things in it, I'm saying. Could be a one-URL barrel I suppose, but even that should get listed twice (once for Wget, once for Heritrix) arcmaj3_barrel_expire($barrelId); echo 'Expired barrel ' . $barrelId . '.'; } } else { if (Rq('amtask') == 'down') { #Client wants a barrel. Compile random URLs from the URL table of unfinished URLs and create a barrel. Mark the URLs as taken. Add barrel to barrels table. #For now, choose an uncompleted URL from the table, and send it. #Number of URLs per bucket: #Default $urlsPerBucket = 20; #Override if (strlen(Rq('NSConfLmDs')) !== 0) { $urlsPerBucket = Rq('NSConfLmDs'); } else { $urlsPerBucket = $urlsPerBucket; } #Barrel format 0.1: #ID,0xURL\n $db = new FractureDB('futuqiur_arcmaj3'); #Make a new barrel. $newBarrelId = $db->addRow('am_barrels', 'status, who, dateAssigned', "'0', '" . Rq('userName') . "', '" . date('Y') . "-" . date('m') . "-" . date('d') . "'"); echo $newBarrelId . "\n"; $projCrawlRq = Rq('projectsToCrawl'); $barrel = arcmaj3_return_barrel($db, $newBarrelId, $urlsPerBucket, $projCrawlRq); echo $barrel; // while ($urlCounter < $urlsPerBucket) { // $rowToReturn = $db->getRandomRow('am_urls', 'barrel', '0'); // $db->setField('am_urls', 'barrel', $newBarrelId, $rowToReturn['id']); // #echo $rowToReturn['id'].','.$rowToReturn['location']; // #Barrel format 0.11: // #0xURL\n // echo $rowToReturn['location'] . "\n"; // $urlCounter++; // } $db->close(); // echo "http://drive.google.com/\n"; // echo "http://wretch.cc/\n"; // echo "http://example.com/\n"; // echo "http://comments.gmane.org/gmane.mail.squirrelmail.plugins/9672\n"; // echo "http://futuramerlin.com\n"; // echo "http://archive.org\n"; // echo "https://archive.org\n"; } else { if (Rq('amtask') == 'expireBarrel') { $barrelId = Rq('barrelId'); arcmaj3_barrel_expire($barrelId); } else { if (Rq('amtask') == 'expireOldBarrels') { $db = new FractureDB('futuqiur_arcmaj3'); # from http://stackoverflow.com/questions/17307587/mysql-datetime-evaluation-get-all-records-whose-value-is-before-midnight-of-the $barrelData = $db->query('SELECT id FROM `am_barrels` WHERE status=0 AND dateAssigned < ( DATE(NOW()) - INTERVAL 1 DAY );'); # print_r($barrelData); foreach ($barrelData as $key => $value) { $barrelId = $value['id']; arcmaj3_barrel_expire($barrelId); } $db->close(); } else { if (Rq('amtask') == 'addUrl') { $db = new FractureDB('futuqiur_arcmaj3'); $newUrl = Rq('amNewUrl'); $pps = $db->getColumn('am_projects', 'urlPattern'); $testProjects = False; $potentialProject = ''; //$pp=fuzzyMatchGetRow('am_projects','projectId','urlPattern','',$limit='')['projectId']; //print_r($pps); foreach ($pps as $ppid) { if (stripos($newUrl, $ppid['urlPattern']) !== false) { $testProjects = True; $potentialProject = $ppid['urlPattern']; } } #$potentialProject = get_domain_simple($value); $projects = $db->getRow('am_projects', 'urlPattern', $potentialProject); $projectId = $projects['id']; #$projectId=1; if ($testProjects) { $newUrlId = $db->addRowFuzzy('am_urls', 'location, project, locationHashUnique', "'" . $db->UrlEscS($newUrl) . "', '" . $projectId . "', '" . hash('sha512', $db->UrlEscS($newUrl)) . "'"); } else { $newUrlId = $db->addRowFuzzy('am_urls', 'location, project, locationHashUnique', "'" . $db->UrlEscS($newUrl) . "', '0', '" . hash('sha512', $db->UrlEscS($newUrl)) . "'"); } echo 'Inserted URL ' . $newUrlId . "<br>\n"; $db->close(); } else { if (Rq('amtask') == 'addProject') { $db = new FractureDB('futuqiur_arcmaj3'); $newUrl = Rq('amSeedUrl'); $newProject = Rq('amFilterPattern'); $newProjectId = $db->addRow('am_projects', 'urlPattern, patternHashUnique', "'" . $db->UrlEscS($newProject) . "', '" . hash('sha512', $db->UrlEscS($newProject)) . "'"); $pps = $db->getColumn('am_projects', 'urlPattern'); $testProjects = False; $potentialProject = ''; //$pp=fuzzyMatchGetRow('am_projects','projectId','urlPattern','',$limit='')['projectId']; //print_r($pps); foreach ($pps as $ppid) { if (stripos($newUrl, $ppid['urlPattern']) !== false) { $testProjects = True; $potentialProject = $ppid['urlPattern']; } } #$potentialProject = get_domain_simple($value); $projects = $db->getRow('am_projects', 'urlPattern', $potentialProject); $projectId = $projects['id']; #$projectId=1; if ($testProjects) { $newUrlId = $db->addRowFuzzy('am_urls', 'location, project, locationHashUnique', "'" . $db->UrlEscS($newUrl) . "', '" . $projectId . "', '" . hash('sha512', $db->UrlEscS($newUrl)) . "'"); } echo 'Inserted project ' . $newProjectId . ' (' . $newProject . ') with seed URL ' . $newUrlId . "<br>\n"; $db->close(); } else { echo 'Unrecognized operation'; } } } } } } } else { echo 'Incorrect protocol auth ID'; } }