mirror of
https://github.com/ivuorinen/BassoFeed.git
synced 2026-01-26 11:34:01 +00:00
Forgot to commit, sorry
This commit is contained in:
@@ -5,6 +5,8 @@ Class for you peeps to get your fav. shows upcoming showtime as an iCal-formatte
|
||||
|
||||
Uses the awesome [simplehtmldom](http://simplehtmldom.sourceforge.net/) as basic scraping tool, you should too check it out.
|
||||
|
||||
Please create your cache-dir before using in production and please do chmod it as writable.
|
||||
|
||||
Usage
|
||||
-----
|
||||
To get, for example the awesome Alas-show's broadcast times you
|
||||
@@ -18,5 +20,4 @@ To get, for example the awesome Alas-show's broadcast times you
|
||||
$basso_alas = new BassoFeed('alas');
|
||||
echo $basso_alas->get_ical();
|
||||
|
||||
|
||||
|
||||
The "new BassoFeed(_showname_)" comes from the url, in Alas' case it's http://www.basso.fi/radio/*alas*
|
||||
@@ -238,24 +238,25 @@ class BassoFeed
|
||||
**/
|
||||
function get_ical()
|
||||
{
|
||||
echo "BEGIN:VCALENDAR\n"
|
||||
."VERSION:2.0\n"
|
||||
."PRODID:-//basso/feed//NONSGML v1.0//EN\n";
|
||||
$cal = "BEGIN:VCALENDAR\n"
|
||||
."VERSION:2.0\n"
|
||||
."PRODID:-//basso/feed//NONSGML v1.0//EN\n";
|
||||
|
||||
foreach( $this->showtimes as $i )
|
||||
{
|
||||
|
||||
echo "BEGIN:VEVENT\n"
|
||||
."UID:".md5($this->show . $i["date_f"])."@basso.fi\n"
|
||||
."DTSTAMP:{$i["date_f"]}\n"
|
||||
."DTSTART:{$i["date_f"]}\n"
|
||||
."DTEND:{$i["date_t"]}\n"
|
||||
."SUMMARY:{$this->showinfo["title"]}\n"
|
||||
."DESCRIPTION:{$this->showinfo["desc"]}\n"
|
||||
."END:VEVENT\n";
|
||||
$cal .= "BEGIN:VEVENT\n"
|
||||
."UID:".md5($this->show . $i["date_f"])."@basso.fi\n"
|
||||
."DTSTAMP:{$i["date_f"]}\n"
|
||||
."DTSTART:{$i["date_f"]}\n"
|
||||
."DTEND:{$i["date_t"]}\n"
|
||||
."SUMMARY:{$this->showinfo["title"]}\n"
|
||||
."DESCRIPTION:{$this->showinfo["desc"]}\n"
|
||||
."END:VEVENT\n";
|
||||
}
|
||||
|
||||
echo "END:VCALENDAR\n";
|
||||
$cal .= "END:VCALENDAR\n";
|
||||
|
||||
return $cal;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
date_default_timezone_set('Europe/Helsinki');
|
||||
|
||||
echo "<pre>";
|
||||
require_once("simple_html_dom.php");
|
||||
require_once("bassofeed.php");
|
||||
|
||||
// http://simplehtmldom.sourceforge.net/manual.htm
|
||||
require_once("simple_html_dom.php");
|
||||
|
||||
echo "<pre>";
|
||||
$basso_alas = new BassoFeed('alas');
|
||||
#print_r($basso_alas);
|
||||
echo $basso_alas->get_ical();
|
||||
|
||||
Reference in New Issue
Block a user