Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

procmail + change subject, w2ksp4.exe download, /proc/kallsyms format, sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header

Links

XODOX
Impressum

#1: pnm strip player help

Posted on 2007-02-21 15:02:47 by ByronDallas

Begging your pardon, :) but I sure could use a little help. I have a
script here that was given to me by a friend of a friend :) And the
middle person knows just as much as I do about cgi/perl, which is
nothing. I know just enough to make this script work at my server (after
several, and I mean several attempts) But whether it is scripted
correctly, I don't know. What I mean, where a line ends and a new line
begins. I do know that a semi-colon ends the line. And can you tell me
the reason for these

||

Some I removed and a couple HAD to stay in. Does that sound correct?

Any help sure would be appreciated.

#!/usr/bin/perl -w
# name script 'pnm.pl'
use CGI;
my $q = new CGI;
my $Song = $q->param('song')
|| '';if ($Song eq '') {print "Content-type: text/||html\n\n";
print qq~<html><head><title>PNM ||Launcher</title></head><body><form
name="f" id="f" ||method="post" action="pnm.pl">URL <input ||type="text"
name="song" id="song" value="" ||size="50" maxlength="300"
/></form></body></html> ||~;}else {chomp($Song);print "Content-type:
||audio/x-pn-realaudio-plugin\n\n";print("$Song\n");}

Report this message

#2: Re: pnm strip player help

Posted on 2007-02-21 19:17:05 by Joe Smith

Byron wrote:
> I don't know. What I mean, where a line ends and a new line
> begins. I do know that a semi-colon ends the line. And can you tell me
> the reason for these
>
> ||
>
> Some I removed and a couple HAD to stay in. Does that sound correct?
>
> Any help sure would be appreciated.

my $Song = $some_variable || ''; # Set $Song to '' if not otherwise defined.

> #!/usr/bin/perl -w
> # name script 'pnm.pl'
> use CGI;
> my $q = new CGI;
> my $Song = $q->param('song')
> || '';if ($Song eq '') {print "Content-type: text/||html\n\n";
> print qq~<html><head><title>PNM ||Launcher</title></head><body><form
> name="f" id="f" ||method="post" action="pnm.pl">URL <input ||type="text"
> name="song" id="song" value="" ||size="50" maxlength="300"
> /></form></body></html> ||~;}else {chomp($Song);print "Content-type:
> ||audio/x-pn-realaudio-plugin\n\n";print("$Song\n");}

Get rid of all the other instances of || and start a new line after each ; .
The last statement {print("$Song\n");} doesn't really do anything.

-Joe

Report this message

#3: Re: pnm strip player help

Posted on 2007-02-21 22:21:49 by ByronDallas

He Joe, I think this is the changes you wanted me to do. I tried making
the changes but I kept getting errors. I'm sure it was a coding error on
my part.

>#!/usr/bin/perl -w
>use CGI::Carp qw(fatalsToBrowser);
># name script 'pnm2.pl'
>use CGI;
>my $q =3D new CGI;
>my $Song =3D $some_variable || ''; =A0
># Set $Song to '' if not otherwise defined.
>if ($Song '')

I had to leave this print in from the bottom:

print("$Song\n");

or I would loose my form url after I clicked onto it.

And if I removed these || from the
|| method=3D"post"

I loose the encrypted song url that the server generates.

I think you'll understand better with what is going on with an example.

This is how I have it coded now. And it seems to be working ok. Please
correct me on any mistakes if there wrong.

http://www.byrondallas.p4h.biz/test/pnm2.txt

This is the tool:

http://www.byrondallas.p4h.biz/test/pnm2.pl

If you will paste the strip below into the tool and click onto it, you
will be able to get the encrypted clickable url. I click "Show Last" on
webtv. It also allows me to time the song from an archive list. Just
click off the form and then back up to change the time settings.

rtsp://archive.wfmu.org/archive/GK/gk041218.rm?start=3D"01:5 5:18"&end=3D"0=
1:57:52"

I don't know if the code is correct, I just know that's what I had to do
to get the tool to perform. Do you see any problems with this? and if so
please correct me. :) I wasn't sure about these || and was worried about
deleting some and leaving some.

Thanks Joe!

Report this message

#4: Re: pnm strip player help

Posted on 2007-02-22 07:11:42 by Joe Smith

Byron wrote:

> I removed these || from the
> || method="post"
> I loose the encrypted song url that the server generates.

The || there is wrong. It should be either
<form method="GET" ...>
or
<form method="POST" ...>
and it sounds like the latter is what you don't want.

> I had to leave this print in from the bottom:
> print("$Song\n");
> or I would loose my form url after I clicked onto it.

Well, "print "DarkSideOfTheMoon.mp3\n" won't do anything.

> rtsp://archive.wfmu.org/archive/GK/gk041218.rm?start="01:55: 18"&end="01:57:52"

Oh, that's different.

> Content-type: audio/x-pn-realaudio-plugin

Sorry, I can't help you with that.
-Joe

Report this message

#5: Re: pnm strip player help

Posted on 2007-02-22 14:05:02 by ByronDallas

Joe wrote:

>The || there is wrong. It should be either =A0
><form method=3D"GET" ...>
>or
>  <form method=3D"POST" ...>
>and it sounds like the latter is what you don't
>want.

Thanks Joe, this is how the line looks now and it seems to be working
fine.

<form name=3D"f" id=3D"f" method=3D"get" action=3D"pnm3.pl">

http://byrondallas.p4h.biz/test/pnm3.pl

And it generates the incrypted url for me.

rtsp://archive.wfmu.org/archive/SO/so021110.rm?start=3D"1:32 :21"&end=3D"1:=
35:21"

http://byrondallas.p4h.biz/test/pnm2.pl?song=3Drtsp%3A%2F%2F archive.wfmu.o=
rg%2Farchive%2FSO%2Fso021110.rm%3Fstart%3D%221%3A32%3A21%22% 26end%3D%221%3=
A35%3A21%22

Now I'll see what I can do about the print line.

Report this message

#6: Re: pnm strip player help

Posted on 2007-02-22 14:53:20 by ByronDallas

I'm sorry Joe, I meant the line is like this: (uppercase)

<form name="f" id="f" method="GET" action="pnm3.pl">

Report this message

#7: Re: pnm strip player help

Posted on 2007-02-22 15:42:00 by ByronDallas

Hey Joe, the bottom line on pnm4 reads like this after removing
print("$Song\n");

print "Content-type: audio/x-pn-realaudio-plugin\n\n";
}

This is the player without the print line.
http://www.byrondallas.p4h.biz/test/pnm4.pl

I'm not sure if your on a computer or WebTV. But on WebTV when I copy
this strip into the form and click it, it seems to play the strip and
even gives me the encrypted url, but I can't hear anything.

rtsp://archive.wfmu.org/archive/SO/so021110.rm?start="1:32:2 1"&end="1:35:21"

It may just be a WebTV thing???

and the line:
"Content-type: audio/x-pn-realaudio-plugin\n\n";
}

is the the type of audio plugin WebTV uses. Which you probably guessed
it anyway. :)

Report this message

#8: Re: pnm strip player help

Posted on 2007-02-23 16:19:20 by ByronDallas

Hey Joe, I really appreciate all the help you've given me. I don't know
if your into Pink Floyd or not, but you did make mention of them, so
here ya go.

http://www.byrondallas.p4h.biz/audio/rams/Pink-Floyd_The-Wal l_Side-2.ram

Report this message