Re: Javascript solution?



On Jul 28, 6:48 am, bruce2005 <br...@xxxxxxxxxxx> wrote:
Hi,

I'm new here, been lurking and trying to learn more. I was wondering
something. I have a client who does text to mp3 changes. The app reads
the text on the webpage and returns an mp3 of it.

So basically the url we have to work with is:
To get the mp3:http://www.talkr.com/app/get_mp3.app?feed_url=http://www.somedomain.xml&;
permalink=http://www.somedomain/articlename.php&url_only=
I can get the mp3 filename into an mp3 player on a page using curl and
php, but we need a javascript solution so more can use it on their
sites.
To extract the mp3 (its like a redirect?) and put it in the filename
in mp3 player on a webpage...

Can this be done in javascript?

Yes. Your client's Webmaster customers would sdd a script block to
their pages that references a PHP script on your server, passing
parameters that identify the page, client ID, etc. Your server-side
script would send back JS that creates a couple of nested object tags
to reference the appropriate MP3 on your server.

Assuming your client isn't going to dictate MIME types to their
customers, you will need a script that can handle both HTML and
XHTML. The simplest way to do that is to design it without
document.write and innerHTML. Use DOM methods (eg createElement,
createElementNS, appendChild, etc.) to create and add the object tags
and you won't have to write two radically different solutions.

And when your server script retrieves pages that do not vary their
content (eg do not change MIME types), you can send a flag to the
client script to tell it which method to use. The reason I would do
this is that client-side detection requires page authors to follow
standards (and you clearly can't control that.) The same could be
said for server-side detection, but I would think that Webmasters who
employ content negotiation on their server would indicate that in
their responses (eg with a Vary header.) Neither method is foolproof,
but fixing server problems is easier than fixing every page on a site.

.



Relevant Pages

  • Re: Banana Republic (was Re: OpenVMS Book Wins award)
    ... overtaken by the more prosaic aspects of supporting WASD. ... for example), that it is better economy, if a client breaks the ... to allow a script to run to completion rather than try and ... The server just throws away ...
    (comp.os.vms)
  • Re: Regarding a selection for mobile code/scripting language
    ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
    (Vuln-Dev)
  • Re: HTTPSConnection script fails, but only on some servers (long)
    ... (HTTP/CONNECT + switch to HTTPS) ... wget and my python script. ... >>The python script works with server A, ... the problem seems to depend on both the client ...
    (comp.lang.python)
  • Re: secure transfers and authentication
    ... Thanks james that looks to be a really handy guide on the whole thing. ... On a side note does anyone know why i have problems posting to the list using the reply function in my mail client? ... From the server ssh to your clients and save the rsa keys ... You could create a script like this: ...
    (Security-Basics)
  • Re: How do we get there from here?
    ... >> executing on the server as a pre-processor. ... If there are client side versions of PHP, ... > name implies a static text file, is it different from a PHP script? ...
    (comp.databases.pick)