Ejemplo n.º 1
0
         if (!$deleteplaylists->execute()) {
             echo 'Error deleting: ', $deleteplaylists->error, PHP_EOL;
         }
     } else {
         echo 'Different-station match found with songid ', $songid, PHP_EOL;
     }
 }
 if ($songid == '') {
     if ($searchcounter <= SEARCH_LIMIT && $searchesrunningtotal + $searchcounter <= SEARCH_HOURLY_LIMIT) {
         $deletesearchqueue->execute();
         $searchcounter++;
         if (!$GSAPI) {
             require_once GSAPI_DIR . 'gsSearch.php';
             $GSAPI = new gsapi(GS_WS_KEY, GS_SECRET);
             $GSAPI->startSession();
             $GSAPI->getCountry($_SERVER['72.64.99.183']);
             $GSAPISearch = new gsSearch();
         }
         $GSAPISearch->setTitle($title);
         $GSAPISearch->setArtist($artist);
         $results = $GSAPISearch->songSearchResults(20);
         $stationstats[$stationid]['searches']++;
         if (count($results) < 1) {
             continue;
         }
         if ($results == null) {
             echo 'No search results, adding to noresults table (this script search counter: ', $searchcounter, ' hourly running total: ', $searchesrunningtotal, ')', PHP_EOL;
             $noresults->execute();
             continue;
         }
         $scoredsongs = array();