[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [syndication] Auto-aggregation of RSS from Blogroll management system



Julian Bond wrote:

Auto-aggregating RSS from Blogrolls
A request to anyone who runs a Blogroll management system or code. eg Blogrolling.com, bloglines.com, Typepad.

When a new site is added to the blogroll, use RSS Auto-discovery to capture the corresponding RSS feed.

This can also be done using Syndic8's XML-RPC interface, as documented
at http://www.syndic8.com/services.php . Simply pass the URL of the
site to the syndic8.FindSites function. The function will return an
array of Syndic8 FeedIDs for the matches. This array can then be
passed to the syndic8.GetFeedInfo function. This function will return
an array of structures; each structure will describe a single feed in
considerable detail.

I'll be happy to support anyone who would like to do this type of
integration; just drop me some email.

Here is some PHP to make the request (pass in the URL as $SiteMatch):

  /* Create XML-RPC request */
  $Request = new xmlrpcmsg('syndic8.FindSites',
                           array(new xmlrpcval($SiteMatch, $xmlrpcString)));

  /* Send request */
  $Ret= $Client->Send($Request) or die("Send failed");

  /* Print result */
  if (!$Ret->faultCode())
  {
    $Val   = $Ret->value();
    $Count = $Val->arraysize();
    print("There are $Count site matches for pattern '$SiteMatch':\n");

    for ($i = 0; $i < $Count; $i++)
    {
      $Obj    = $Val->arraymem($i);
      $FeedID = $Obj->scalarval();

      print("[$i]: $FeedID - ");

      $Request2 = new xmlrpcmsg('syndic8.GetFeedInfo',
                                array(new xmlrpcval($FeedID, $xmlrpcInt)));

      $Ret2 = $Client->Send($Request2) or die("Send failed");

      if (!$Ret2->faultCode())
      {
        $Val2       = $Ret2->value();
        $DataURLVal = $Val2->structmem('dataurl');
        $DataURL    = $DataURLVal->scalarval();

        print($DataURL . "\n");
      }
    }
  }

Jeff;