PDA

View Full Version : Podcasting PHP script, generates RSS and HTML for files


dbwalker.com
Dec 29th, 2005, 10:22 AM
Hey ... I wrote this PHP script that generates an RSS feed and HTML when you drop it in a directory of files. I wrote it for myself ... but I figure others may like it as well.

The idea is to never have to write HTML or XML, just produce the audio, drop it in a directory and the rest is taken care of by the script.

Features:
* Auto generate HTML in a blog style
* Auto Generate XML for an RSS feed
* iTunes tag support
* Files can be hosted on multiple sites
* And more....
* Free!

http://www.dbwalker.com/utils/utils.html

monkey_one
Dec 29th, 2005, 10:51 AM
im on a mac is it compadible

dbwalker.com
Dec 29th, 2005, 11:14 AM
It runs on your web server, not on your local machine.

But, Mac OS X is unix and can run it locally if you turn on web sharing and PHP support.

Just to be clear then .... this script goes in a folder of files on your web server. To add files to your podcast you just upload them to the folder on the server ... and thats it ... the RSS and HTML are auto generated.

If you want to see the script in action, go to my site ....

When you load: http://www.dbwalker.com/podcast/podcast.html, the episode listing html is generated by the script.

When you load http://podcast.dbwalker.com, the rss is generated by the script.

kcrockett
Dec 29th, 2005, 12:29 PM
Your so freakin awesome!

monkey_one
Dec 29th, 2005, 12:32 PM
PRETTY COOL

kinkysex
Dec 29th, 2005, 12:33 PM
Brilliant! Good job.

ElNacho
Dec 29th, 2005, 12:55 PM
Hey ... I wrote this PHP script that generates an RSS feed and HTML when you drop it in a directory of files. I wrote it for myself ... but I figure others may like it as well.

The idea is to never have to write HTML or XML, just produce the audio, drop it in a directory and the rest is taken care of by the script.

Features:
* Auto generate HTML in a blog style
* Auto Generate XML for an RSS feed
* iTunes tag support
* Files can be hosted on multiple sites
* And more....
* Free!

http://www.dbwalker.com/utils/utils.html

huh...
is there an easy file to mod so that instead of making an xml...i can changed the output code do show , say, a pickle player and a link to it? Given it's an html file rather than xml, of course...

dbwalker.com
Dec 29th, 2005, 01:20 PM
I'm not sure about the Pickle Player thing ... never seen one before.

However .... check this out ... this makes me smile...
(Note: emoticon restraint here)

12:00 PM, Sat down to do an episode
12:08 Pressed record
12:12 Pressed stop
12:15 Posted show
DONE!

A 3.5 min show, done in 15 min..... COOL!

ElNacho
Dec 29th, 2005, 01:25 PM
well what im asking is, well what im asking is, instead of having it put <item>
<stuff>stuffagain</stuff>
</item>
have it put
<embed src="thing.mp3" fancy fancy >
Title (thing.mp3)

dbwalker.com
Dec 29th, 2005, 01:38 PM
Yes....


The script allows extra XML and HTML to be included, fairly easily, without writing PHP code.... check out the readme ... in the "Not so fast start" section.

http://www.dbwalker.com/utils/readme/readme.html

ElNacho
Dec 29th, 2005, 02:27 PM
marg..troubles...
u wudint, perhaps, happen to have any kind of instant messagin client thing?

dbwalker.com
Dec 29th, 2005, 02:47 PM
I dont do IM ... too everything interuptus ... post the issue here and perhaps we can deal with it.

ElNacho
Dec 29th, 2005, 03:45 PM
****

well here's the setupHTML function, which is what ive changed:

function setupHTML( $itemTitle, $itemDescription )
{
// Get the HTML for this item

$iTunesFeed = strtok($this->itemFeed, ":");
$iTunesFeed = strtok(":");
$iTunesFeed = "itpc:" . $iTunesFeed;
$fileHTML = "<object classid=‘clsid:d27cdb6e-ae6d-11cf-96b8-444553540000’ codebase=‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0’ width=‘300’ height=‘30’ id=‘pcpp’ align=‘middle’>
<param name=‘allowScriptAccess’ value=‘sameDomain’ />
<param name=‘movie’ value=‘http://www.podcastpickle.com/podPlayer/pcpp.swf?URI=http://www.podtrac.com/pts/redirect.mp3? " . $this->fileURL . "&instantLoad=0’ />
<param name=‘quality’ value=‘high’ />
<param name=‘bgcolor’ value=‘#000000’ />
<embed src=‘http://www.podcastpickle.com/podPlayer/pcpp.swf?URI=http://www.podtrac.com/pts/redirect.mp3? " . $this->fileURL . "&instantLoad=0’ quality=‘high’ bgcolor=‘#000000’ width=‘300’ height=‘30’ name=‘pcpp’ align=‘middle’ allowScriptAccess=‘sameDomain’ type=‘application/x-shockwave-flash’ pluginspage=‘http://www.macromedia.com/go/getflashplayer’ />
</object>";
$fileHTML = "<hr><h2><a href=\"" . $this->fileURL . "\">" . $itemTitle . " - " . $this->fileName . "</h2></a>
";
if (file_exists($this->filePath . $this->fileName . ".html"))
{
$fileHTML .= file_get_contents($this->filePath . $this->fileName . ".html");
} else if (file_exists($this->filePath . "default.item.html"))
{
$fileHTML .= "This episode is the file: " . $this->fileName . "
";
$fileHTML .= file_get_contents($this->filePath . "default.item.html");
} else $fileHTML .= $itemDescription . " - " . $this->fileName ;
return $fileHTML;
}



what the focal point here is is this:

$fileHTML = "<object classid=‘clsid:d27cdb6e-ae6d-11cf-96b8-444553540000’ codebase=‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0’ width=‘300’ height=‘30’ id=‘pcpp’ align=‘middle’>
<param name=‘allowScriptAccess’ value=‘sameDomain’ />
<param name=‘movie’ value=‘http://www.podcastpickle.com/podPlayer/pcpp.swf?URI=http://www.podtrac.com/pts/redirect.mp3? " . $this->fileURL . "&instantLoad=0’ />
<param name=‘quality’ value=‘high’ />
<param name=‘bgcolor’ value=‘#000000’ />
<embed src=‘http://www.podcastpickle.com/podPlayer/pcpp.swf?URI=http://www.podtrac.com/pts/redirect.mp3? " . $this->fileURL . "&instantLoad=0’ quality=‘high’ bgcolor=‘#000000’ width=‘300’ height=‘30’ name=‘pcpp’ align=‘middle’ allowScriptAccess=‘sameDomain’ type=‘application/x-shockwave-flash’ pluginspage=‘http://www.macromedia.com/go/getflashplayer’ />
</object>";
$fileHTML = "
<hr><h2><a href=\"" . $this->fileURL . "\">" . $itemTitle . " - " . $this->fileName . "</h2></a>

";

the embedded object is the pickle player (a flash player that streams an audio file), and below that is the file name, which is a link to the file. whenever i try to load the page, it gives me an error that says "Fatal error: Maximum execution time of 30 seconds exceeded in /home/rambling/public_html/episode/podcast.php on line 298"

i've only got the "test" mp3 up there...do i have to upload everythin in that folder, or just the podcast.php?

(btw this is the site: http://episode.meadnale.com/)

dbwalker.com
Dec 29th, 2005, 04:00 PM
seems like you are assigning the $fileURL variable several times, as to the error, not sure .... whats at line 298? I'm pretty sure that PHP is line oriented as well so if there are any CR's or LF's in your html you will need to fix that.

It would be better to just use the HTML include mechanism described in the read me and embed the player in the comments for each episode.

ElNacho
Dec 29th, 2005, 04:06 PM
readmes are for sissies, i prefer to bother other people with my petty questions and screw up the code beyond repair...

fine, ill read the readme. but dont think im enjoying it!

ElNacho
Dec 29th, 2005, 04:50 PM
whenever the program runs, even before i make any changes (i reverted back to original), it gives me

Fatal error: Maximum execution time of 30 seconds exceeded in /home/rambling/public_html/episode/podcast.php on line 291

The line keeps on running around...

ill just have my friend program something simpler and more suited to my perposes

thanx anyways tho

dbwalker.com
Dec 29th, 2005, 06:50 PM
Mmmmmm ...

THe script is having a problem resolving the URL it is at ...

At the top of the script, put the values in for $dataURL and $feedURL.

alexkillby
Dec 30th, 2005, 07:49 AM
looks like too much trouble :(, anyone got it to work?

dbwalker.com
Dec 30th, 2005, 02:20 PM
Anyone try it out yet?

vader
Dec 31st, 2005, 02:21 PM
very nice dude. Thanks.

jake359
Jan 1st, 2006, 09:16 AM
seems very cool.
Here's what I've been wanting:

Some kind of outliner that allows me to outline a show, including hyperlinks, and then output that into simple HTML that I can cut and paste into a WordPress Blog post.

Wordpress itself handles the RSS feeds pretty nicely, including enclosures, at least using the iPodCatter plugin. But I've yet to find an outliner that will let me write my outline, make my show, and then export the outline into shownotes-friendly HTML. Ideally, it would generate MediaWiki code too, so i could cut and paste everything into there as well (I have my shownotes on shownotes.com).

M$Word writes really crappy HTML. I tried Open Office, which is better, but still needs XHTML cleanup. Dave Winer's OPML Editor might do it, but I'm too far down the geek curve to figure it out. Any ideas?

dbwalker.com
Jan 2nd, 2006, 11:13 AM
I tend to edit HTML in BBEdit ... Sometimes I use GO live... but it's just cleaner to do it by hand for me ....

Sorry no ideas here.

jake359
Jan 2nd, 2006, 11:31 AM
well, yeah, i tend to use a text editor...but i like the idea of outlining the show, and then using that outline to stick right into shownotes.

I'm trying one today in dreamweaver, but that is a pricey option for an outliner...