Solved

RSS Feed import to other Calendar apps

Posted on 2011-02-22
5
2,612 Views
Last Modified: 2014-11-12
I have an RSS feed that is based on an internal calendar database app.

What's the best way to have people import that RSS feed into their own calendars regardless of what app they are using i.e. MS Outlook, Google Calendar, Lotus Notes etc...
I have attached the RSS feed page image.
calendar-rss-feed.bmp
0
Comment
Question by:awarraic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 34961030
That's a good question and I have never tried to make an RSS feed into a calendar application - they are just two separate things.  However there may be a way by providing a link to a vCal file.

The <item> tag has a place for a link.
http://cyber.law.harvard.edu/rss/rss.html#hrelementsOfLtitemgt

This link could point to a script on your calendar application that generates a little vcal file, something like this.  The script is in the code snippet.
http://www.nationalpres.org/NPC_calendar_vcal.php?k=2945

Sorry it's not very pretty (legacy code from many years ago) but it works for our needs.

HTH, ~Ray
<?php // http://www.NationalPres.org/NPC_calendar_vcal.php
error_reporting(E_ALL ^ E_NOTICE);
$config_page = $_SERVER["DOCUMENT_ROOT"] . '/' . 'config.php';             require_once($config_page);
$cal_funcs   = $_SERVER["DOCUMENT_ROOT"] . '/' . 'calendar_functions.php'; require_once($cal_funcs);
if (bad_robots()) { die(); }



$_key        = $_GET["k"];
if (!is_clean_numeric_string($_key)) die("Bad Key");

$filename = "NPCEvent" . $_key . ".vcs";
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: inline; filename=$filename");


$sql = "SELECT * FROM $calendar_table WHERE _key = $_key LIMIT 1 ";
if (!$result = mysql_query($sql)) { fatal_error($sql); }
$num_rows = mysql_num_rows($result);

if ($num_rows == 0) {
    echo "Sorry, the <b>Event Key $_key</b> is not found in the $calendar_table data base.<br /><br />\n";
    echo "Please report this error to the NPC Communications Office.<br /><br />\n";
    die("Sorry, Unable to add to your calendar.");
}
if ($num_rows != 1) {
    echo "SQL $sql<br>";
    echo "RESULT $result<br><br>";
    echo "The <b>Event Key $_key</b> appears to have $num_rows data base entries in $calendar_table (yikes!)<br />\n";
    echo "Please report this error to the NPC Communications Office.<br /><br />\n";
    die("Sorry, Unable to add to your calendar.");
}

$calendar_array = mysql_fetch_assoc($result); 

extract($calendar_array);

$loc = trim($location);
if ($loc  != '') { $loc = '=0D=0A=Location: ' . $loc; }

$poc1 = trim($poc1_name .' '. $poc1_phone .' '. $poc1_email);
if ($poc1 != '') { $poc1 = '=0D=0A=Contact: ' . $poc1; }

$poc2 = trim($poc2_name .' '. $poc2_phone .' '. $poc2_email);
if ($poc2 != '') { $poc2 = '=0D=0A=Contact: ' . $poc2; }

$pocw = trim($poc_url);
if ($pocw != '') { $pocw = '=0D=0A=WWW: ' . $pocw; }

$poc = $poc1 . $poc2 . $pocw;

// CALENDAR TOLERATES END TIMESTAMPS WRONG OR OMITTED - VCAL DOES NOT
$vcal_dtstart = date('Y-m-d\TH:i:sO', strtotime($start . " -1 hour"));
$vcal_dtend   = date('Y-m-d\TH:i:sO', strtotime($end . " -1 hour"));
if ($vcal_dtend < $vcal_dtstart) { $vcal_dtend = $vcal_dtstart; }


?>BEGIN:VCALENDAR
VERSION:1.0
PRODID:NPC Online Calendar
BEGIN:VEVENT
SUMMARY:<?php echo "$title" . PHP_EOL; ?>
DESCRIPTION;ENCODING=QUOTED-PRINTABLE:<?php echo "$details" . "$loc" . "$poc" . PHP_EOL; ?>
DTSTART:<?php echo $vcal_dtstart . PHP_EOL; ?>
DTEND:<?php echo $vcal_dtend . PHP_EOL; ?>
END:VEVENT
END:VCALENDAR

Open in new window

0
 

Author Comment

by:awarraic
ID: 34974134
@Ray, how does this code work?
Do I have to add config.php and calendar.php files?
What's the $_key?
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 34974761
No, you do not have to add the config or calendar scripts from our framework - just substitute your own versions.  The only thing this script calls from the framework are error handlers, etc.  Should be pretty easy to figure out.

$_key is the key number for the row in the calendar table.  See line 9 where it is acquired and line 17 where it is used.
0
 

Author Closing Comment

by:awarraic
ID: 34979245
Thanks Ray. First time I heard about this Vcal thing, pretty cool. Once I created .ics file; I just dragged and dropped into lotus notes and all the events were in :)
Thanks again for all the help.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 34983979
Thanks for the points.  I love the vCal.  There is a more advanced version of the standard now, but the older standard works perfectly and never confuses anyone.  Best regards, ~Ray
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
replace quotes with UTF-8 character 38 112
Questions about this React unit test 4 70
Google Sheets Script 21 93
asp Google Map 2 56
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The choice of selecting a perfect productive suite for one’s organization is a critical decision that an IT Manager or a CIO has to make. And when it comes to choosing a cloud-based productivity suite, the choice gets all the more difficult. This is…
This Micro Tutorial demonstrates in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question