mirror of
https://github.com/ivuorinen/BassoFeed.git
synced 2026-03-10 21:58:09 +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.
|
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
|
Usage
|
||||||
-----
|
-----
|
||||||
To get, for example the awesome Alas-show's broadcast times you
|
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');
|
$basso_alas = new BassoFeed('alas');
|
||||||
echo $basso_alas->get_ical();
|
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()
|
function get_ical()
|
||||||
{
|
{
|
||||||
echo "BEGIN:VCALENDAR\n"
|
$cal = "BEGIN:VCALENDAR\n"
|
||||||
."VERSION:2.0\n"
|
."VERSION:2.0\n"
|
||||||
."PRODID:-//basso/feed//NONSGML v1.0//EN\n";
|
."PRODID:-//basso/feed//NONSGML v1.0//EN\n";
|
||||||
|
|
||||||
foreach( $this->showtimes as $i )
|
foreach( $this->showtimes as $i )
|
||||||
{
|
{
|
||||||
|
$cal .= "BEGIN:VEVENT\n"
|
||||||
echo "BEGIN:VEVENT\n"
|
."UID:".md5($this->show . $i["date_f"])."@basso.fi\n"
|
||||||
."UID:".md5($this->show . $i["date_f"])."@basso.fi\n"
|
."DTSTAMP:{$i["date_f"]}\n"
|
||||||
."DTSTAMP:{$i["date_f"]}\n"
|
."DTSTART:{$i["date_f"]}\n"
|
||||||
."DTSTART:{$i["date_f"]}\n"
|
."DTEND:{$i["date_t"]}\n"
|
||||||
."DTEND:{$i["date_t"]}\n"
|
."SUMMARY:{$this->showinfo["title"]}\n"
|
||||||
."SUMMARY:{$this->showinfo["title"]}\n"
|
."DESCRIPTION:{$this->showinfo["desc"]}\n"
|
||||||
."DESCRIPTION:{$this->showinfo["desc"]}\n"
|
."END:VEVENT\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');
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
date_default_timezone_set('Europe/Helsinki');
|
date_default_timezone_set('Europe/Helsinki');
|
||||||
|
|
||||||
echo "<pre>";
|
require_once("simple_html_dom.php");
|
||||||
require_once("bassofeed.php");
|
require_once("bassofeed.php");
|
||||||
|
|
||||||
// http://simplehtmldom.sourceforge.net/manual.htm
|
echo "<pre>";
|
||||||
require_once("simple_html_dom.php");
|
|
||||||
|
|
||||||
$basso_alas = new BassoFeed('alas');
|
$basso_alas = new BassoFeed('alas');
|
||||||
#print_r($basso_alas);
|
echo $basso_alas->get_ical();
|
||||||
|
|||||||
Reference in New Issue
Block a user