Author Topic: How to use Export to web feature?  (Read 51698 times)

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5689
    • Radio DJ
How to use Export to web feature?
« on: June 09, 2013, 11:53:37 AM »
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:

Code: [Select]
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:
Code: [Select]
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

  • Global Moderator
  • Hero Member

  • Offline
  • *****
  • 4392
  • Personal Text
    Don't Shoot! I'm only the Moderator
    • DJ Garybaldy Blog
Re: How to use Export to web feature?
« Reply #1 on: June 14, 2013, 12:59:12 PM »
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.
Retired DJ & Proud USER of RadioDJ since 2010

https://djgarybaldy.blogspot.com

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

RadioDJ is the Swiss Army Knife of radio playout software

RadioDJ is my favourite software EVER!

Marius

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5689
    • Radio DJ
Re: How to use Export to web feature?
« Reply #2 on: June 14, 2013, 01:03:36 PM »
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

  • Guest
Re: How to use Export to web feature?
« Reply #3 on: July 17, 2013, 03:38:00 PM »
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

  • Guest
Re: How to use Export to web feature?
« Reply #4 on: August 27, 2013, 03:41:30 PM »
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

  • New User

  • Offline
  • *
  • 31
Add "track_type" to the Export to web feature?
« Reply #5 on: October 26, 2013, 08:10:16 AM »
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

  • New User

  • Offline
  • *
  • 3
Re: How to use Export to web feature?
« Reply #6 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 this
Quote
Jethro Tull - Warm Sporran
what i need to do for show this instead(vertical):
Quote
Artist: 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

  • Guest
Re: How to use Export to web feature?
« Reply #7 on: February 01, 2014, 04:41:54 AM »
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

  • Full Member

  • Offline
  • ***
  • 217
    • Our official website
Re: How to use Export to web feature?
« Reply #8 on: February 20, 2014, 02:21:51 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

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5689
    • Radio DJ
Re: How to use Export to web feature?
« Reply #9 on: February 20, 2014, 03:09:59 PM »
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

  • Full Member

  • Offline
  • ***
  • 217
    • Our official website
Re: How to use Export to web feature?
« Reply #10 on: February 21, 2014, 02:03:58 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

  • Jr. Member

  • Offline
  • **
  • 92
Re: How to use Export to web feature?
« Reply #11 on: February 22, 2014, 03:07:23 PM »
Is it possible to Add the Show with the artist and Title
such as
  "The Wendy Williams Show"
    "Jodeci"
    "Stay"

HMC

  • Full Member

  • Offline
  • ***
  • 181
Re: How to use Export to web feature?
« Reply #12 on: July 08, 2014, 01:33:40 AM »
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

  • Administrator
  • Hero Member

  • Offline
  • *****
  • 5689
    • Radio DJ
Re: How to use Export to web feature?
« Reply #13 on: July 08, 2014, 06:52:31 AM »
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

  • Full Member

  • Offline
  • ***
  • 181
Re: How to use Export to web feature?
« Reply #14 on: July 08, 2014, 07:01:11 AM »
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