• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

Export To Web Doesn't Work

Started by marcbeinder, December 22, 2017, 08:45:07 AM

Brodephat

#15
Quote from: marcbeinder on December 22, 2017, 08:45:07 AM
It keeps requiring me to put in a password. However I don't use a password to export. I need to be able to send a simple get request.

I just use any password in the password field of the RadioDJ web export even if one is not needed in the php script
"Think Outside The Box And Make Something Truly Wonderful Happen"

Youtube Channel: https://bit.ly/3fGBsKJ

My RadioDJ Stations:
NiaRadioNetwork.com
RealPeopleTalkRadio.com
TheTriadComeUp.com

Radio Imaging & Tools:
CarterScripts.com

Free RDJ Videos:
HowToUseRadioDJ.com

marcbeinder

Quote from: Jhonny on December 25, 2017, 10:52:00 PM
Will this work?


<?php
include_once("db_connect.php");
//$tracktype = $_GET['tracktype'];

//if ($tracktype == 0){

date_default_timezone_set('America/Chicago');
$date date('Y-m-d H:i:s');

if(isset(
$_GET['trackid'])) {
    
$trackid $_GET['trackid'];
}


$sql_upcome "SELECT * FROM `$data`.`centracore_history_widget` ORDER BY id DESC LIMIT 1 ";
        
$upcomeresults mysqli_query($db$sql_upcome) or die(mysql_error());
        if(
mysqli_num_rows($upcomeresults) > 0) {
            while(
$row mysqli_fetch_assoc($upcomeresults)) {
                
$dartist $row['artist'];
                
$trackid $row['trackID'];
}}

$sql_getsong "SELECT * FROM `$data`.`songs` WHERE ID=$trackid";
        
$getsongresults mysqli_query($db$sql_getsong) or die(mysql_error());
        if(
mysqli_num_rows($getsongresults) > 0) {
            while(
$row mysqli_fetch_assoc($getsongresults)) {
                
$sartist $row['artist'];
                
$title $row['title'];
                
$artwork $row['image'];
                
$songtype $row['song_type'];
}}

if(
$songtype==0){

if(
$sartist != $dartist){

$createhistory "INSERT IGNORE INTO centracore_history_widget (title,artist,artwork) VALUES ('$title','$sartist','$artwork')";

mysqli_query($db$createhistory);



//Update RSS Feed
/*
$ofile=file_get_contents("feed.rss");
$nfile="<?xml version='1.0' encoding='utf-8'?>

<rss version='2.0'>
    <channel>
        <generator>RSS Builder by B!Soft</generator>
        <title>RUOLradio.com Song History</title>
        <link>RUOLradio.com</link>
        <description>Song History</description>
        <language>en-us</language>
        <copyright>RUOLradio.com</copyright>
        <image>
            <title>RUOLradio.com Song History</title>
            <link>RUOLradio.com</link>
            <url>http://cronus.centracoresoftware.com/RUOL/img/no_image.jpg</url>
            <width>100</width>
            <height>100</height>
        </image>
    </channel>
        <item>
        <title>$title by $sartist</title>
        <pubDate>$date</pubDate>
        <description> <![CDATA[<img src='http://cronus.centracoresoftware.com/$subdomain/img/$artwork'></img>]]></description>
        </item>

        $ofile
        ";
file_put_contents("feed.rss", $nfile);*/
}
}



//}



?>


Hi Jhonny,

After looking of the script I don't think this will work. This part here:


$sql_upcome = "SELECT * FROM `$data`.`centracore_history_widget` ORDER BY id DESC LIMIT 1 ";
        $upcomeresults = mysqli_query($db, $sql_upcome) or die(mysql_error());
        if(mysqli_num_rows($upcomeresults) > 0) {
            while($row = mysqli_fetch_assoc($upcomeresults)) {
                $dartist = $row['artist'];
                $trackid = $row['trackID'];
}}


is checking for the trackID column in the centracore_history_widget table. The problem with that is that I want to insert the data into that same table. So checking to see if that data is already in that table is pointless because I can already confirm that it's not. The table is emptied weekly. Any record with that trackID would be out dated.

I'm going to restate that when this script is executed in a browser it works perfectly fine, but when RDJ attempts to send the GET request it does not. As far as I can tell RDJ is not sending the GET request. Is there a log somewhere that I can access to confirm this?
RiseRadio.org // Podtrics.com

Marius

RDJ is sending for sure that data (tested and confirmed).
For testing purposes, try a simple script without other complications (like database manipulation & stuff). I attached a sample script and the settings i used for the test.
The script will write the received data to the "data.txt" file. Make sure that is writable (777 on linux).
Test script: https://nofile.io/f/8tH00a9DQqp/trackid_test.zip

[attachment deleted by admin]
DOWNLOADS PAGE

HOW TO FIX RADIODJ DATABASE
----------------
Please don't PM me for support requests. Use the forums instead.

marcbeinder

Quote from: Marius on January 01, 2018, 01:19:44 PM
RDJ is sending for sure that data (tested and confirmed).
For testing purposes, try a simple script without other complications (like database manipulation & stuff). I attached a sample script and the settings i used for the test.
The script will write the received data to the "data.txt" file. Make sure that is writable (777 on linux).
Test script: https://nofile.io/f/8tH00a9DQqp/trackid_test.zip

That did it! I'm able to send to my script now perfectly!
RiseRadio.org // Podtrics.com