Thanks a lot, Benjamin. That did the trick. Here's my test code.
<?php
header("content-type: text/html");
$staturl = '
http://127.0.0.1:4664/
status&s=EhWJ08sJtIsy_sZkCkr8Gx_PeIw';
if (!$fp = fopen($staturl,"r")) die("Can't read the status<p>");
while (!feof($fp)) {
$data = fgets($fp);
if (stristr($data, "searchable")) {
$items=trim(strip_tags(fgets($fp)));
$update=trim(strip_tags(fgets($fp)));
break;
}
}
print_r("items=$items update=$update<p>");
?>
On May 8, 10:06 am, "Benjamin [API Guru]" <codename.mat...@gmail.com>
wrote:
> Hi,
> there is no way to directly retrieve this information. You will have
> to parse the status page. To get the correct link to the status page
> just scan the search page for the correct link. You can check out the
> source of my index status gadget to see what you need to look for. It
> shouldn't be hard to convert the code to PHP5 since PHP already
> provides regex parsing capabilities.
> Seehttp://code.google.com/p/desktopgadgets/source/browse/trunk/GoogleDes...
> for the index specific code.
> Best regards,
> Benjamin
> On May 8, 4:00 pm, CraigHyatt <craig.hy...@sonyericsson.com> wrote:
> > Hi,
> > I have a great app running that's built off of Google Desktop. I
> > recently added a statistics page. I want to use the API (or any other
> > method) to retrieve the number of indexed items and the most recent
> > update time just like you see on the Index Status page. I am running
> > Apache as my web server and interfacing to the search engine using
> > PHP5 (parsing the XML results returned). (I am not using the
> > "toolkit" proper, but I can install it if necessary.)
> > I tried something like "http://127.0.0.1:4664/status&s=<mykey>" but it
> > returns an error. If I could get that to work, I'd be golden.
> > P.S. I searched the web and faqs but didn't find anything... search
> > terms are too common and I get too many results back.
> > Thanks,
> > Craig- Hide quoted text -
> - Show quoted text -