spacer.png, 0 kB
qisoftware business blog

« Validating Blogger Calendar Feed | Main | Blog Monetization »

Friday, March 25, 2011

PHP Source for Valid Blogger Calendar Feed

The following PHP source code can be used to generate a valid blog feed from a Thingamablog generated xml file that has been encoded to also provide data used with the Blogger Calendar.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
$ch = curl_init();
$url="http://blog.yourdomain.com/rss.xml";
curl_setopt ($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);
curl_close ($ch);
$result=get_between($result,"<?xml","<BeginCalSec>");
echo "<?xml".$result."</channel></rss>";
?>
<?php
function get_between($input, $start, $end)
{
  $substr = substr($input, strlen($start)+strpos($input, $start), (strlen($input) - strpos($input, $end))*(-1));
 return $substr;
}
?>

You would place the php file "blogrss.php" in the appropriate directory, where "blogrss" is anything you specify. Then use a url similar to this: http://blog.yourdomain.com/blogrss.php when your blog feed URL is requested by services like, NetworkedBlogs or Feedburner.

This fix negates the need for server side Java support with the Thingamablog version of the Blogger Calendar.



Business Directory

spacer.png, 0 kB

| Contact | Accessibility | Products | CSS and XHTML
© Copyright 2010-2017 QiSoftware
You may not copy this work.



    InBusiness
    Sponsors









    Amazon Associate
    2012-2013 Cumulative Stats
    Data From: 01-01-12 thru 12-27-13
    ImpsClksAddCartOrders
    1230014977

    Last Change
    +40+100

    More
    Twitter

    Calendar
    Pages
    Archives
    Categories
    Credits
    Powered by
    Thingamablog 1.1b6



spacer.png, 0 kB