Thank you :-).
any good source code repository for APIs?

On 6/29/07, Brian Butterworth <[EMAIL PROTECTED]> wrote:
Luf,

Most of it can be done by using the $arrText=file("http://bbc.co.uk/.....";);
and examing the results.  If it's XML you can use the PHP XML functions...

Just as a general pointer, I use this function to grab stuff from RSS feeds:




function getRSSfeed($intSiteID, $strWebAddress, $intWebPort,
$strWebDocument, $intMinLevel, $intSkip)

{
    $simple = file("http://$strWebAddress"; .
":$intWebPort/$strWebDocument");

    $p = xml_parser_create();
    xml_parse_into_struct($p, $simple, $vals, $index);
    xml_parser_free($p);

    // Connect to database to check for existing already...
    $link = mysql_connect(MYSQLHOST, MYSQLUSER, MYSQLPASS) or die("Could not
connect");
    mysql_select_db(MYSQLDB) or die("Could not select database");

    // Delete old items
    $query = "DELETE FROM tblXXX WHERE (intSiteID=$intSiteID);";
    $result = mysql_query($query) or die("Write Query $query failed");

    $strTitle="";
    $strURL="";

    foreach ($vals as $index => $val)
    {

      if ($val["type"] == "complete" && $val["level"]>=$intMinLevel)
        {

        if ($val["tag"]=="TITLE") $strTitle=addslashes  ($val["value"]);
        if ($val["tag"]=="LINK")  $strURL=$val["value"];


        if ($val["tag"]=="LINK")
          {
          //echo "<a href=\"$strURL\">$strTitle</a><br>";
          $query = "INSERT INTO tblXXX (strURL, strText, intSiteID) VALUES
(\"$strURL\", \"$strTitle\", $intSiteID);";

       if ($intSkip>=0)
            {
            $result = mysql_query($query) or die("Write Query $query
failed");
            };
          $intSkip+=1;

        }

      }
   }

}

then use something like...


   $intWebPort=80; $intLevels=3;
   $strWebAddress="newsrss.bbc.co.uk";
$strWebDocument="/rss/newsonline_uk_edition/technology/rss.xml";
$strTitle="BBC NEWS"; $intDrop=-1;

     getRSSfeed($intSiteID, $strWebAddress, $intWebPort, $strWebDocument,
$intLevels, $intDrop);


Hope this points you in the right direction.





On 28/06/07, Luf Luf <[EMAIL PROTECTED]> wrote:
>
> Hello,
> Were can I find PHP APIs for BBC content.
>
> thanks,
> Luf
> -
> Sent via the backstage.bbc.co.uk discussion group.  To unsubscribe, please
visit
http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.
 Unofficial list archive:
http://www.mail-archive.com/[email protected]/
>



--
Please email me back if you need any more help.

Brian Butterworth
www.ukfree.tv
-
Sent via the backstage.bbc.co.uk discussion group.  To unsubscribe, please 
visit http://backstage.bbc.co.uk/archives/2005/01/mailing_list.html.  
Unofficial list archive: http://www.mail-archive.com/[email protected]/

Reply via email to