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

How to use Export to web feature?

Started by Marius, June 09, 2013, 11:53:37 AM

Marius

In v1.6.3.9 i implemented a simple title exporter for websites.
This feature can be used when the user don't want to have database connections to the rdj computer.

How it works?
When the track is changing, it sends two parameters using POST to the URL entered by the user.

First parameter is "xpwd" which is the user password and the second parameter is the "title", which is the title constructed by the user rules in rdj options on streaming titles for every track type.

There is also the option to send custom data with custom parameters.
An example of custom data can be:

artist=$artist$&title=$title$&albumart=$album_cover$

The (php?) file located to the server must handle the parameters that are passed by the user.

A simple php example that handles the automated titles, without custom parameters:

Let's name this file "myhardtoguessname.php"

Code (php) Select

<?php

If ((isset($_POST["xpwd"])) && (isset($_POST["title"]))) {
$xpwdstripcslashes($_POST["xpwd"]);
if ($xpwd== 'changeme') {
$data stripcslashes($_POST["title"]);

$Handle fopen("data.txt"'w');
fwrite($Handle$data); 
fclose($Handle);
}
} Else {
echo "Go away!";
}

?>



Make sure that the password is the same with the one you've entered in now playing info plugin.

Now, we need to create also a text file with write permission on the same folder as "myhardtoguessname.php". We name the text file "data.txt".

In plugin playing info, we enter the URL to our php file:
http://yoursite.com/myhardtoguessname.php

When the track will change in rdj, the text file from your web server file should contain the artist and title that was send from rdj.

From here, you can include it in your website to show to your visitors the playing track.

The full list of variables for custom data:
$path$
$track_id$
$artist$
$title$
$album$
$album_cover$
$year$
$track_no$
$disc_no$
$bpm$
$duration$
$durationinSeconds$
$station_name$
$station_slogan$

When using the plugin without custom parameters, in rdj options-stream titles you can use two more variables:

$rotation_id$
$listeners$

[attachment deleted by admin]
DOWNLOADS PAGE

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

DJ Garybaldy

Just noticed a small bug in Export to web. If a song title has a & symbol in it the now playing song title only shows up with one word of the artists full name.

i.e Echo & the Bunnymen - Seven seas only showed up in the data text file as "Echo"  :bash:

Other than that the export to web plugin is working OK.
Worlds Biggest Fan of RadioDJ

Install MariaDB https://djgarybaldy.blogspot.com/2020/08/installing-maria-db.html

Install RadioDJ: https://djgarybaldy.blogspot.com/2020/08/how-to-install-radiodj-free-radio.html

Into Internet radio for 25 years 1999-2024

RadioDJ 2045 MariaDB 11.2 Windows 11

Marius

Hmmm, that's because it thinks that is another parameter. I will search for a solution, maybe to replace it in the plugin before it sends to the page.
DOWNLOADS PAGE

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

gnaag

I don't know whether you have been doing something with the "& in song title" problem. However now I am not able to pass multiple arguments over POST. It simply takes the first argument and appends everyhing that is right to it not considering any &)

RRradio

Hi!

I've got a problem with this.

It posts nothing but password if I write something in "Custom Data" field. I understood that in this field you can define variables that you want to be posted (e.g. $track_id$), but seems that isn't working. If this field is empty. it posts data as specified in general options.

Why so? :) We kinda need one type type of stream info to be saved locally and another to be posted to the web.

mmanderson

This web export is really working!

But I see a slight problem, "track_type" is not exported.

We use track_type a lot to set colors in the playlist and we have songs > jingles > station ID's > special features etc and so we rely upon the tracktype a lot.

When we export to web, and try to list, there is no easy way to list only songs eg track_type=0 from station ID's, Jingles etc.

Please add track_type as an available export to web variable!

Thanks a lot.

Christian

 :)Hi, sorry for my english but i`m not native speaker.

I have a few questions.

1-when i show the information from web export it shows like this
QuoteJethro Tull - Warm Sporran
what i need to do for show this instead(vertical):
QuoteArtist: Jethro Tull
Track: Warm Sporran
Album: Stormwatch
Year: 1979

2-how i can add the parameters of genres and country to the track info
Quote
Genre: Progressive rock
Origin: Uk

thanks for your help!!! :ok:

AndyDeGroo

So far it works great, but can I have $song_type$ as well. Please, Marius. :)
I'd like to display titles only for songs and that filed would help to filter data.

linawebradio

Quote from: Christian on January 02, 2014, 11:30:39 PM
:)Hi, sorry for my english but i`m not native speaker.

I have a few questions.

1-when i show the information from web export it shows like thiswhat i need to do for show this instead(vertical):
2-how i can add the parameters of genres and country to the track info
thanks for your help!!! :ok:
No one answered this question...
Is anyone could help us to do that?
Thanks!  :ok:
www.linawebradio.it
La tua Social Radio!

Marius

I cannot understand the first question.
For the second, this feature is for displaying basic info on websites, genre and countries are not supported yet. The country info is not available even in the main program, so i cannot see how you could display it.
DOWNLOADS PAGE

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

linawebradio

Quote from: Marius on February 20, 2014, 03:09:59 PM
I cannot understand the first question.
[...]
The first question was:
1) When I show the information from web export it shows like this
Jethro Tull - Warm Sporran

...what i need to do for show this instead (vertical):

Artist: Jethro Tull
Track: Warm Sporran
Album: Stormwatch
Year: 1979
www.linawebradio.it
La tua Social Radio!

Daviscd01

Is it possible to Add the Show with the artist and Title
such as
  "The Wendy Williams Show"
    "Jodeci"
    "Stay"

HMC

Can someone PLEASE tell me how to add custom data to web export?

I tried "$track_id$" and "-$track_id$" and nothing. It just won't work with any custom data. What exactly do you put in the Custom Data field?

It's really difficult to figure somethings out with RDJ because of no formal documentation. As soon as I learn the program better I think I'll draft some up because it's really challenging when topics are spread all over the place and some on the site.
Radio DJ 1.7.5 Update with MariaDB 10

Marius

What are you trying to do?
Anything you will put to custom data field will be passed to the specified URL using the selected method (POST/GET).
What is containing your target page on which the custom data is sent? Also put here the entire custom data you are trying to send.
DOWNLOADS PAGE

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

HMC

Hi Marius,

I just want to get the track_id so that I can associate the songs each time it sends the post with an album art file on my server via PHP. I'm using Last.fm.

The web exporter works fine until I put the custom data then it stops working altogether and doesn't send anything.

I just need to know how that custom field works and how to include the track_id.
Radio DJ 1.7.5 Update with MariaDB 10