Computer ForumsComputers  

Go Back   Computer Forums > The World Wide Web > Web Graphics, design, digital images

Reply
 
LinkBack Thread Tools Display Modes
Old 06-25-2007, 07:49 AM   #1 (permalink)
Greg
Indeed.
 
Greg's Avatar
 
Join Date: Dec 2004
Posts: 1,457
Default Help me with CGI/Perl

I'm trying to write a CGI script that will generate an HTML file showing what is playing in my media player, Amarok. The command that outputs the artist and title is:
Code:
echo `dcop amarok player nowPlaying`
but when I include it in the CGI script it is just blank. The "date" command, however, works like a charm. When you load the page it will tell you the current time and date in bold, just like it should. Here is the current script with the working date command:
Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head>\n";
print "<title>Test</title></head>\n";
print "<body>\n";
print "<b>";
print `date`;
print "</b>\n";
print "</body></html>\n";
Now how do I get it to work with the other command? Keep in mind I know basically nothing about Perl.

Oh, and when I just run the script from the command line it works fine as well. Here is what it gives me:
Code:
greg@Carl:~/apache/nowplaying$ perl playing.pl
Content-type: text/html

<html><head>
<title>Test</title></head>
<body>
<b>The Flaming Lips - Superhumans
</b>
</body></html>
greg@Carl:~/apache/nowplaying$
Thanks in advance for any help, and sorry for this crappy post. It's late and I'm tired.
__________________
Greg is offline   Reply With Quote
Old 06-26-2007, 10:47 AM   #2 (permalink)
Greg
Indeed.
 
Greg's Avatar
 
Join Date: Dec 2004
Posts: 1,457
Default Re: Help me with CGI/Perl

Nevermind. I just ended up writing an Amarok script. Here is the result:

http://img243.imageshack.us/img243/8245/screeniean9.png

Simple, but it does exactly what I want it to do.
__________________
Greg is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:21 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8