Google Groups Home
Help | Sign in
How to get the number of indexed items using the API
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
CraigHyatt  
View profile
 More options May 8, 10:00 am
From: CraigHyatt <craig.hy...@sonyericsson.com>
Date: Thu, 8 May 2008 07:00:29 -0700 (PDT)
Local: Thurs, May 8 2008 10:00 am
Subject: How to get the number of indexed items using the API
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benjamin [API Guru]  
View profile
 More options May 8, 10:06 am
From: "Benjamin [API Guru]" <codename.mat...@gmail.com>
Date: Thu, 8 May 2008 07:06:33 -0700 (PDT)
Local: Thurs, May 8 2008 10:06 am
Subject: Re: How to get the number of indexed items using the API
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.

See http://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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CraigHyatt  
View profile
 More options May 8, 11:27 am
From: CraigHyatt <craig.hy...@sonyericsson.com>
Date: Thu, 8 May 2008 08:27:09 -0700 (PDT)
Local: Thurs, May 8 2008 11:27 am
Subject: Re: How to get the number of indexed items using the API
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:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google