public function PageLoad()
    {
        ob_clean();
        $this->presenter->PageLoad();
        $config = Configuration::Instance();
        $feed = new FeedWriter(ATOM);
        $title = $config->GetKey(ConfigKeys::APP_TITLE);
        $feed->setTitle("{$title} Reservations");
        $url = $config->GetScriptUrl();
        $feed->setLink($url);
        $feed->setChannelElement('updated', date(DATE_ATOM, time()));
        $feed->setChannelElement('author', array('name' => $title));
        foreach ($this->reservations as $reservation) {
            /** @var FeedItem $item */
            $item = $feed->createNewItem();
            $item->setTitle($reservation->Summary);
            $item->setLink($reservation->ReservationUrl);
            $item->setDate($reservation->DateCreated->Timestamp());
            $item->setDescription(sprintf('<div><span>Start</span> %s</div>
										  <div><span>End</span> %s</div>
										  <div><span>Organizer</span> %s</div>
										  <div><span>Description</span> %s</div>', $reservation->DateStart->ToString(), $reservation->DateEnd->ToString(), $reservation->Organizer, $reservation->Description));
            $feed->addItem($item);
        }
        $feed->genarateFeed();
    }
Exemple #2
0
 function rss()
 {
     global $REQUEST_ASSOC, $TPA;
     if ($node = $this->_tree->getNodeInfo($REQUEST_ASSOC['id'])) {
         Common::inc_module_factory('feedWriter', true);
         //Creating an instance of FeedWriter class.
         //The constant RSS2 is passed to mention the version
         $feed = new FeedWriter();
         //Setting the channel elements
         //Use wrapper functions for common channel elements
         $feed->setTitle(CHOST . ' - ' . $node['basic']);
         $feed->setLink(CHOST);
         $feed->setDescription(CHOST);
         //Image title and link must match with the 'title' and 'link' channel elements for RSS 2.0
         //$TestFeed->setImage('Testing the RSS writer class','http://www.ajaxray.com/projects/rss','http://www.rightbrainsolution.com/images/logo.gif');
         //Use core setChannelElement() function for other optional channels
         $node['params']['lang'] = 'ru';
         $feed->setChannelElement('language', $node['params']['lang']);
         if ($interval = $this->_common_obj->select_news_interval($node_id, 0, 10, '', '', false, $active = 1)) {
             foreach ($interval as $news) {
                 //Create an empty FeedItem
                 $newItem = $feed->createNewItem();
                 //Add elements to the feed item
                 //Use wrapper functions to add common feed elements
                 $newItem->setTitle($news['header']);
                 $newItem->setLink($TPA->page_link . '/~shownews/' . $news['id']);
                 //The parameter is a timestamp for setDate() function
                 $date = strtotime($news['sortdate']);
                 $newItem->setDate($date);
                 $newItem->setDescription($news['news_short']);
                 $newItem->addElement('author', '*****@*****.**');
                 //Attributes have to passed as array in 3rd parameter
                 $newItem->addElement('guid', 'http://www.ajaxray.com', array('isPermaLink' => 'true'));
                 //Now add the feed item
                 $feed->addItem($newItem);
             }
             $feed->genarateFeed();
             die;
         }
     }
 }
Exemple #3
0
 /**
  * Generates a RSS feed from an external RSS feed
  *
  * @param $url string The URL of the external feed
  * @return void
  */
 public function rssProxy($url)
 {
     $this->_remoteRSS = array();
     $this->_feed = new FeedWriter();
     $this->loadRSSFeed($url);
     $version = $this->_remoteRSS["version"];
     $version = floatval($version);
     if ($version <= 1.0) {
         $version = RSS1;
     } else {
         $version = RSS2;
     }
     $this->_feed->setVersion($version);
     $this->_feed->setTitle($this->_remoteRSS["title"]);
     $this->_feed->setDescription($this->_remoteRSS["description"]);
     $this->_feed->setLink($this->_remoteRSS["link"]);
     $this->_feed->setImage($this->_remoteRSS["image"]["title"], $this->_remoteRSS["image"]["url"], $this->_remoteRSS["image"]["link"]);
     $this->_feed->setChannelElement("language", $this->_remoteRSS["language"]);
     $this->_feed->setChannelElement('pubDate', $this->_remoteRSS["pubDate"]);
     if (isset($this->_remoteRSS["items"]) && count($this->_remoteRSS["items"]) > 0) {
         foreach ($this->_remoteRSS["items"] as $item) {
             $title = $this->_filter->encodeHTML($item["title"]);
             $link = $item["link"];
             $pubDate = $item["pubDate"];
             $description = $item["description"];
             if (isset($item["enclosure"])) {
                 $enclosure = array("url" => $item["enclosure"]["url"], "length" => $item["enclosure"]["length"], "type" => $item["enclosure"]["type"]);
                 $this->addEnclosureContent($title, $link, $pubDate, $description, $enclosure);
             } else {
                 $this->addContent($title, $link, $pubDate, $description);
             }
         }
     }
     header('Content-type: text/xml');
     $this->_feed->genarateFeed();
 }
Exemple #4
0
function _sort_pages($page1, $page2)
{
    if ($page1->getLastUpdatedAt() == $page2->getLastUpdatedAt()) {
        return 0;
    }
    // Desc
    return $page1->getLastUpdatedAt() > $page2->getLastUpdatedAt() ? -1 : 1;
}
usort($pages, '_sort_pages');
/** Start Feed Output **/
$last_updated_at = null;
$feed = new FeedWriter(RSS2);
$feed->setTitle(SITE_NAME);
$feed->setLink(url_for("/", IS_ABSOLUTE_URL));
$feed->setDescription(SITE_DESC);
$feed->setChannelElement('language', 'zh-cn');
// get flat pages
foreach ($pages as $page) {
    $page_updated_at = $page->getLastUpdatedAt();
    if (!$last_updated_at || $page_updated_at > $last_updated_at) {
        $last_updated_at = $page_updated_at;
    }
    $render = new SimpieView($page->getPageFilePath(), '../templates/layout/feed.php');
    $feed_item = $feed->createNewItem();
    $feed_item->setTitle($page->getAbsTitle());
    $feed_item->setLink($page->getUrl(IS_ABSOLUTE_URL));
    $feed_item->setDescription($page->getPageContent($render));
    $feed_item->setDate($page_updated_at);
    $feed_item->addElement('author', 'TIPI-Team');
    $feed->addItem($feed_item);
}
Exemple #5
0
<?php

include "FeedWriter.php";
// IMPORTANT : No need to add id for feed or channel. It will be automatically created from link.
//Creating an instance of FeedWriter class.
//The constant ATOM is passed to mention the version
$TestFeed = new FeedWriter(ATOM);
//Setting the channel elements
//Use wrapper functions for common elements
$TestFeed->setTitle('Testing the RSS writer class');
$TestFeed->setLink('http://www.ajaxray.com/rss2/channel/about');
//For other channel elements, use setChannelElement() function
$TestFeed->setChannelElement('updated', date(DATE_ATOM, time()));
$TestFeed->setChannelElement('author', array('name' => 'Anis uddin Ahmad'));
//Adding a feed. Genarally this protion will be in a loop and add all feeds.
//Create an empty FeedItem
$newItem = $TestFeed->createNewItem();
//Add elements to the feed item
//Use wrapper functions to add common feed elements
$newItem->setTitle('The first feed');
$newItem->setLink('http://www.yahoo.com');
$newItem->setDate(time());
//Internally changed to "summary" tag for ATOM feed
$newItem->setDescription('This is test of adding CDATA Encoded description by the php <b>Universal Feed Writer</b> class');
//Now add the feed item
$TestFeed->addItem($newItem);
//OK. Everything is done. Now genarate the feed.
$TestFeed->genarateFeed();
Exemple #6
0
} else {
    $webid = $user_hash;
}
// IMPORTANT : No need to add id for feed or channel. It will be automatically created from link.
//Creating an instance of FeedWriter class.
//The constant ATOM is passed to mention the version
$Feed = new FeedWriter(ATOM);
//Setting the channel elements
if ($user_hash != 'local') {
    $Feed->setTitle('MyProfile Pingbacks/Notifications Feed');
} else {
    $Feed->setTitle('MyProfile Wall Feed');
}
$Feed->setLink($base_uri . '/feed.php?id=' . $user_hash);
//For other channel elements, use setChannelElement() function
$Feed->setChannelElement('updated', date(DATE_ATOM, time()));
$Feed->setChannelElement('author', array('name' => 'WebID Test Suite'));
// fetch messages for the selected webid
// Limited to Wall posts until we can secure the private messages better
$query = "SELECT * FROM pingback_messages WHERE to_hash='" . mysql_real_escape_string($user_hash) . "' AND wall='1' ORDER BY date DESC LIMIT 10";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
    //Create an empty FeedItem
    $newItem = $Feed->createNewItem();
    // The message sender's name
    $name = $row['name'];
    //Add elements to the feed item
    //Use wrapper functions to add common feed elements
    if ($row['wall'] == 1) {
        $newItem->setTitle('Wall message.');
        // Display wall if it's not a personal message
Exemple #7
0
<?php

require_once 'FeedWriter.php';
require_once '../Spyc.php';
require_once '../functions.php';
$TestFeed = new FeedWriter(ATOM);
$TestFeed->setTitle('F**k-Huff-Duff. Very Private Sonar Feed.');
$TestFeed->setLink('http://' . $_SERVER['HTTP_HOST'] . '/' . get_subdir($_SERVER[PHP_SELF]) . '/');
#print_r(get_subdir($_SERVER[PHP_SELF]));
$TestFeed->setChannelElement('updated', date(DATE_ATOM, time()));
$TestFeed->setChannelElement('author', array('name' => 'Juicy Cocktail (http://juicycocktail.com/)'));
$items = Spyc::YAMLLoad('../urls.yaml');
foreach ($items as $item) {
    $newItem = $TestFeed->createNewItem();
    $newItem->setTitle($item['title']);
    $newItem->setLink($item['link']);
    $newItem->setDate($item['date']);
    $newItem->setDescription($item['description']);
    $newItem->setEncloser($item['enc_link'], $item['enc_length'], 'audio/mpeg');
    $TestFeed->addItem($newItem);
}
# Please don’t mastarbate.
$TestFeed->genarateFeed();
Exemple #8
0
<?php

include "FeedWriter.php";
//Creating an instance of FeedWriter class.
//The constant RSS2 is passed to mention the version
$TestFeed = new FeedWriter(RSS2);
//Setting the channel elements
//Use wrapper functions for common channel elements
$TestFeed->setTitle('Testing & Checking the RSS writer class');
$TestFeed->setLink('http://www.ajaxray.com/projects/rss');
$TestFeed->setDescription('This is test of creating a RSS 2.0 feed Universal Feed Writer');
//Image title and link must match with the 'title' and 'link' channel elements for RSS 2.0
$TestFeed->setImage('Testing the RSS writer class', 'http://www.ajaxray.com/projects/rss', 'http://www.rightbrainsolution.com/images/logo.gif');
//Use core setChannelElement() function for other optional channels
$TestFeed->setChannelElement('language', 'en-us');
$TestFeed->setChannelElement('pubDate', date(DATE_RSS, time()));
//Adding a feed. Genarally this portion will be in a loop and add all feeds.
//Create an empty FeedItem
$newItem = $TestFeed->createNewItem();
//Add elements to the feed item
//Use wrapper functions to add common feed elements
$newItem->setTitle('The first feed');
$newItem->setLink('http://www.yahoo.com');
//The parameter is a timestamp for setDate() function
$newItem->setDate(time());
$newItem->setDescription('This is test of adding CDATA Encoded description by the php <b>Universal Feed Writer</b> class');
$newItem->setEncloser('http://www.attrtest.com', '1283629', 'audio/mpeg');
//Use core addElement() function for other supported optional elements
$newItem->addElement('author', 'admin@ajaxray.com (Anis uddin Ahmad)');
//Attributes have to passed as array in 3rd parameter
$newItem->addElement('guid', 'http://www.ajaxray.com', array('isPermaLink' => 'true'));
     // Get the index template file.
     include_once $index_file;
     //Now that we have the whole index page generated, put it in cache folder
     if ($index_cache != 'off') {
         $fp = fopen($cachefile, 'w');
         fwrite($fp, ob_get_contents());
         fclose($fp);
     }
 } else {
     if ($filename == 'rss' || $filename == 'atom') {
         $filename == 'rss' ? $feed = new FeedWriter(RSS2) : ($feed = new FeedWriter(ATOM));
         $feed->setTitle($blog_title);
         $feed->setLink($blog_url);
         if ($filename == 'rss') {
             $feed->setDescription($meta_description);
             $feed->setChannelElement('language', $language);
             $feed->setChannelElement('pubDate', date(DATE_RSS, time()));
         } else {
             $feed->setChannelElement('author', $blog_title . ' - ' . $blog_email);
             $feed->setChannelElement('updated', date(DATE_RSS, time()));
         }
         $posts = get_all_posts();
         if ($posts) {
             $c = 0;
             foreach ($posts as $post) {
                 if ($c < $feed_max_items) {
                     $item = $feed->createNewItem();
                     // Remove HTML from the RSS feed.
                     $item->setTitle(substr($post['post_title'], 4, -6));
                     $item->setLink(rtrim($blog_url, '/') . '/' . str_replace(FILE_EXT, '', $post['fname']));
                     $item->setDate($post['post_date']);
Exemple #10
0
function projects_rss()
{
    global $clerk, $project;
    $feed = new FeedWriter(RSS2);
    $title = $clerk->getSetting("site", 1);
    $feed->setTitle($title . ' / Projects Feed');
    $feed->setLink(linkToSite());
    $feed->setDescription('Live feed of projects on ' . $title);
    $feed->setChannelElement('pubDate', date(DATE_RSS, time()));
    $projects = $clerk->query_select("projects", "", "WHERE publish= 1 ORDER BY id DESC");
    while ($project = $clerk->query_fetchArray($projects)) {
        $newItem = $feed->createNewItem();
        $newItem->setTitle($project['title']);
        $newItem->setLink(html_entity_decode(linkToProject($project['id'])));
        $newItem->setDate($project['date']);
        $desc = projectThumbnail();
        $desc = call_anchor("projectsRssDescription", $desc);
        $newItem->setDescription('' . $desc . '');
        $newItem->addElement('guid', linkToProject($project['id']), array('isPermaLink' => 'true'));
        $feed->addItem($newItem);
        $count = 0;
        $desc = "";
    }
    $feed->genarateFeed();
}
Exemple #11
0
 /**
  * Generate RSS feed
  */
 public function generateRSS()
 {
     include 'FeedWriter.php';
     include 'FeedItem.php';
     $feed = new FeedWriter(RSS2);
     $wall = $this->getContent();
     $title = !empty($this->domain) ? $this->domain : $this->owner_id;
     $feed->setTitle('vk.com/' . $title);
     $feed->setLink('http://vk.com/' . $title);
     $feed->setDescription('wall from vk.com/' . $title);
     $feed->setChannelElement('language', 'ru-ru');
     $feed->setChannelElement('pubDate', date(DATE_RSS, time()));
     foreach (array_slice($wall->response, 1) as $post) {
         $newItem = $feed->createNewItem();
         $newItem->setLink("http://vk.com/wall{$post->to_id}_{$post->id}");
         $newItem->setDate($post->date);
         $description = $post->text;
         if (isset($post->copy_text)) {
             # additional content in re-posts
             $description .= (empty($description) ? '' : self::VERTICAL_DELIMITER) . $post->copy_text;
         }
         if (isset($post->attachment->photo->text) and !empty($post->attachment->photo->text)) {
             $description .= (empty($description) ? '' : self::VERTICAL_DELIMITER) . $post->attachment->photo->text;
         }
         if (isset($post->attachment->video->text) and !empty($post->attachment->video->text)) {
             $description .= (empty($description) ? '' : self::VERTICAL_DELIMITER) . $post->attachment->video->text;
         }
         if (isset($post->attachment->link)) {
             $description .= (empty($description) ? '' : self::VERTICAL_DELIMITER) . $post->attachment->link->title . '<br/>' . $post->attachment->link->description;
         }
         if (!is_null($this->include) && preg_match('/' . $this->include . '/iu', $description) !== 1) {
             continue;
         }
         if (!is_null($this->exclude) && preg_match('/' . $this->exclude . '/iu', $description) !== 0) {
             continue;
         }
         $hashTags = array();
         $description = preg_replace('/\\[[^|]+\\|([^\\]]+)\\]/u', '$1', $description);
         // remove internal vk links
         preg_match_all('/#([\\d\\w_]+)/u', $description, $hashTags);
         if (isset($post->attachments)) {
             foreach ($post->attachments as $attachment) {
                 switch ($attachment->type) {
                     case 'photo':
                         $description .= "<br><img src='{$attachment->photo->src_big}'/>";
                         break;
                         /*case 'audio': {
                             $description .= "<br><a href='http://vk.com/wall{$owner_id}_{$post->id}'>{$attachment->audio->performer} &ndash; {$attachment->audio->title}</a>";
                             break;
                           }*/
                     /*case 'audio': {
                         $description .= "<br><a href='http://vk.com/wall{$owner_id}_{$post->id}'>{$attachment->audio->performer} &ndash; {$attachment->audio->title}</a>";
                         break;
                       }*/
                     case 'doc':
                         $description .= "<br><a href='{$attachment->doc->url}'>{$attachment->doc->title}</a>";
                         break;
                     case 'link':
                         $description .= "<br><a href='{$attachment->link->url}'>{$attachment->link->title}</a>";
                         break;
                         /*case 'video': {
                             $description .= "<br><a href='http://vk.com/video{$attachment->video->owner_id}_{$attachment->video->vid}'><img src='{$attachment->video->image_big}'/></a>";
                             break;
                           }*/
                 }
             }
         }
         $newItem->setDescription($description);
         $newItem->addElement('title', $this->getTitle($description));
         $newItem->addElement('guid', $post->id);
         foreach ($hashTags[1] as $hashTag) {
             $newItem->addElement('category', $hashTag);
         }
         $feed->addItem($newItem);
     }
     $feed->generateFeed();
 }
Exemple #12
0
 /**
  * Generate RSS feeds for current user
  *
  * @param $token
  * @param $user_id
  * @param $tag_id if $type is 'tag', the id of the tag to generate feed for
  * @param string $type the type of feed to generate
  * @param int $limit the maximum number of items (0 means all)
  */
 public function generateFeeds($token, $user_id, $tag_id, $type = 'home', $limit = 0)
 {
     $allowed_types = array('home', 'fav', 'archive', 'tag');
     $config = $this->store->getConfigUser($user_id);
     if ($config == null) {
         die(sprintf(_('User with this id (%d) does not exist.'), $user_id));
     }
     if (!in_array($type, $allowed_types) || !isset($config['token']) || $token != $config['token']) {
         die(_('Uh, there is a problem while generating feed. Wrong token used?'));
     }
     $feed = new FeedWriter(RSS2);
     $feed->setTitle('wallabag — ' . $type . ' feed');
     $feed->setLink(Tools::getPocheUrl());
     $feed->setChannelElement('pubDate', date(DATE_RSS, time()));
     $feed->setChannelElement('generator', 'wallabag');
     $feed->setDescription('wallabag ' . $type . ' elements');
     if ($type == 'tag') {
         $entries = $this->store->retrieveEntriesByTag($tag_id, $user_id);
     } else {
         $entries = $this->store->getEntriesByView($type, $user_id);
     }
     // if $limit is set to zero, use all entries
     if (0 == $limit) {
         $limit = count($entries);
     }
     if (count($entries) > 0) {
         for ($i = 0; $i < min(count($entries), $limit); $i++) {
             $entry = $entries[$i];
             $newItem = $feed->createNewItem();
             $newItem->setTitle($entry['title']);
             $newItem->setSource(Tools::getPocheUrl() . '?view=view&amp;id=' . $entry['id']);
             $newItem->setLink($entry['url']);
             $newItem->setDate(time());
             $newItem->setDescription($entry['content']);
             $feed->addItem($newItem);
         }
     }
     $feed->genarateFeed();
     exit;
 }
$output->setDescription($feed->get_description());
$output->setXsl('css/feed.xsl');
// Chrome uses this, most browsers ignore it
if ($valid_key && isset($_GET['pubsub'])) {
    // used only on fivefilters.org at the moment
    $output->addHub('http://fivefilters.superfeedr.com/');
    $output->addHub('http://pubsubhubbub.appspot.com/');
    $output->setSelf('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
$output->setLink($feed->get_link());
// Google Reader uses this for pulling in favicons
if ($img_url = $feed->get_image_url()) {
    $output->setImage($feed->get_title(), $feed->get_link(), $img_url);
}
if ($format == 'atom') {
    $output->setChannelElement('updated', date(DATE_ATOM));
    $output->setChannelElement('author', array('name' => 'Five Filters', 'uri' => 'http://fivefilters.org'));
}
////////////////////////////////////////////
// Loop through feed items
////////////////////////////////////////////
$items = $feed->get_items(0, $max);
// Request all feed items in parallel (if supported)
$urls_sanitized = array();
$urls = array();
foreach ($items as $key => $item) {
    $permalink = htmlspecialchars_decode($item->get_permalink());
    // Colons in URL path segments get encoded by SimplePie, yet some sites expect them unencoded
    $permalink = str_replace('%3A', ':', $permalink);
    $permalink = $http->validateUrl($permalink);
    if ($permalink) {
Exemple #14
0
 protected function rss()
 {
     global $onpub_disp_rss, $onpub_disp_updates_num, $onpub_disp_friendly_urls;
     if ($this->website && $onpub_disp_rss) {
         // See the following OnpubAPI tutorial for more info:
         // http://onpub.com/index.php?s=20&a=78
         // This example is based on an example by Anis uddin Ahmad, the author of
         // Universal Feed Writer.
         //Creating an instance of FeedWriter class.
         //The constant RSS2 is passed to mention the version
         $feed = new FeedWriter(RSS2);
         //Setting the channel elements
         //Use wrapper functions for common channel elements
         $feed->setTitle($this->website->name);
         $feed->setLink(addTrailingSlash($this->website->url));
         $feed->setDescription('');
         //Image title and link must match with the 'title' and 'link' channel elements for RSS 2.0
         if ($this->website->image) {
             $feed->setImage($this->website->name, addTrailingSlash($this->website->url), addTrailingSlash($this->website->imagesURL) . $this->website->image->fileName);
         } else {
             $feed->setImage($this->website->name, addTrailingSlash($this->website->url), null);
         }
         //Use core setChannelElement() function for other optional channels
         $feed->setChannelElement('language', 'en-us');
         $feed->setChannelElement('pubDate', date(DATE_RSS, time()));
         $qo = new OnpubQueryOptions();
         $qo->includeContent = true;
         $qo->includeAuthors = true;
         $qo->orderBy = 'created';
         $qo->order = 'DESC';
         $qo->rowLimit = $onpub_disp_updates_num;
         $articles = $this->articles->select($qo, null, $this->website->ID);
         //Adding a feed. Genarally this portion will be in a loop and add all feeds.
         foreach ($articles as $article) {
             // Get the article's authors.
             $authors = $article->authors;
             //Create an empty FeedItem
             $newItem = $feed->createNewItem();
             //Add elements to the feed item
             //Use wrapper functions to add common feed elements
             // Use the OnpubArticle object to set the various properties of the FeedItem.
             $newItem->setTitle($article->title);
             $samaps = $this->samaps->select(null, null, $article->ID);
             if ($onpub_disp_friendly_urls) {
                 $newItem->setLink(addTrailingSlash($this->website->url) . $this->generateFriendlyURL(NULL, $article, $samaps[0]->sectionID));
             } else {
                 $newItem->setLink(addTrailingSlash($this->website->url) . 'index.php?s=' . $samaps[0]->sectionID . '&a=' . $article->ID);
             }
             //The parameter is a timestamp for setDate() function
             $newItem->setDate($article->getCreated()->format('c'));
             $newItem->setDescription($this->friendlyURLs($article->content));
             if (sizeof($authors)) {
                 //Use core addElement() function for other supported optional elements
                 $newItem->addElement('author', $authors[0]->displayAs);
             }
             //Now add the feed item
             $feed->addItem($newItem);
         }
         //OK. Everything is done. Now genarate the feed.
         $feed->genarateFeed();
     }
 }
Exemple #15
0
function blog_rss()
{
    global $clerk, $blog;
    $feed = new FeedWriter(RSS2);
    $title = $clerk->getSetting("site", 1);
    $feed->setTitle($title . ' / Blog Feed');
    $feed->setLink(linkToSite());
    $feed->setDescription('Live feed of blog posts on ' . $title);
    $feed->setChannelElement('pubDate', date(DATE_RSS, time()));
    $get = $clerk->query_select("secretary_blog", "", "ORDER BY date DESC");
    while ($blog = $clerk->query_fetchArray($get)) {
        $newItem = $feed->createNewItem();
        $newItem->setTitle($blog['title']);
        $newItem->setLink(html_entity_decode(linkToPost(false, $blog['id'])));
        $newItem->setDate($blog['date']);
        $desc = postImage() . '<br />' . postText();
        $desc = call_anchor("blogRssDescription", $desc);
        $newItem->setDescription('' . $desc . '');
        $newItem->addElement('guid', linkToPost(), array('isPermaLink' => 'true'));
        $feed->addItem($newItem);
        $count = 0;
        $desc = "";
    }
    $feed->genarateFeed();
}
$debuglog .= "<pre> Total Items in View = [" . $result->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView . "]</pre>\n";
if ($result->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView == 1) {
    # IF there's only one item, $appts isn't read as an array... so we force it here.
    $appts = array($result->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem);
} else {
    $appts = $result->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;
}
if ($scriptdebug) {
    #If we're debugging add the apps the and result info to the debug log.
    $debuglog .= '<div><hr><p>Result</p><pre>' . print_r($result, true) . "</pre></div>";
}
include "FeedWriter/FeedWriter.php";
$CalFeed = new FeedWriter(ATOM);
$CalFeed->setTitle('Exchange Calendar Feed from ' . $StartDate->format('D M j Y') . " to " . $EndDate->format('D M j Y'));
$CalFeed->setLink('./');
$CalFeed->setChannelElement('author', array('name' => 'Carlos Tronco'));
$CalFeed->setChannelElement('updated', date(DATE_ATOM, time()));
#Let's iterate through the list of appts and get each appt and get more info than FindItem gave us.
foreach ($appts as $appt) {
    #Let's _not_ show appts/meetings marked as Private....
    if ($appt->Sensitivity == 'Normal') {
        #Build the XML/object for the GetItemRequest
        $GetItemRequest = null;
        $GetItemRequest->ItemShape->BaseShape = "AllProperties";
        $GetItemRequest->ItemIds->ItemId->Id = $appt->ItemId->Id;
        $GetItemRequest->ItemIds->ItemId->ChangeKey = $appt->ItemId->ChangeKey;
        if ($scriptdebug) {
            $debuglog .= "<hr><p>Appt used to build GetItem Request</p><pre>" . print_r($appt, true);
            $debuglog .= "</pre><hr><p>Appt Info</p><pre>";
            $debuglog .= "ItemId - Id = [" . $appt->ItemId->Id . "]\n";
            $debuglog .= "ItemId - ChangeKey = [" . $appt->ItemId->ChangeKey . "]\n";