Author Topic: External Text http source  (Read 2726 times)

joelwitkowski

  • Newbie
  • *
  • Posts: 11
External Text http source
« on: June 17, 2014, 05:23:18 pm »
I am interested in using a plain text file as a text source that is hosted online at a website.  Of course, using the plain text file stored locally on the system works fine.  But looking to the http link, it does not want to process a single line at a time, instead pushing the entire file to the assigned field, regardless of how "Process" is defined.  Is there some manner of a line break delineating character I need in the file in order to do this?

The ultimate goal would be to get an advertiser to sponsor, for instance, the RadioText field -without any intervention from our end.  For instance, a car dealership might have a text file listing their inventory at their website, ie: http://www.usedautolot.com/uploads/RDS.txt:

2007 Ford Ranger, 5 speed, under 70K, just $7495!
2011 Kia Forte, AC, Auto, 40mpg, 33K miles, just $8995!

And we put a sample file on our website to test this, and it does not break at the line breaks.

I am certain that I've just missed something.  Any information you can provide me with is sure to be useful.

Jan

  • Hero Member
  • *****
  • Posts: 783
Re: External Text http source
« Reply #1 on: June 17, 2014, 06:46:47 pm »
The HTTP text source always reads and processes entire file. An exception exists only for RSS because RSS structure is well known, so RSS can be processed per post.
(This means that getting the text file in XML format (standard RSS 2.0) from the advertiser is one of possible solutions!)

For general http files, the line separator is unknown. It may be br tag, </p>...<p> (HTML) or CR+LF (plain text) as well. Solving the line-per-line task using this method is not effective and it's not supported because (not only) this functionality can be easily provided by PHP or ASP script directly on the web server.

The PHP can generate either a plain text file containing actual text line or a complete website with the text line located anywhere in their content - the Magic RDS can simply find the text field using the following method:

In your PHP file create a line

Code: [Select]
<div class="RDS">.....</div>
In the Text source options fill
Cut everything before (and including): <div class="RDS">
Cut everything after (and including): </div>

The text between the div tags will be sent to the RDS encoder.