1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Google API php Class

Discussion in 'Google API' started by noppid, Apr 22, 2005.

  1. #1
    OK, so I wrote a google API php Class.

    What would be the type of queries that one would want to display if such a tool was posted with access to the api?


    Thanks
     
    noppid, Apr 22, 2005 IP
  2. gford

    gford Peon

    Messages:
    1,188
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This is the exact type of thing I have been looking for.

    I am not up to speed on their API but one thing I'd love is a way to pass a URL and get a nice green bar (like in the google toolbar) of that sites rank.

    Once I read more on google api I am sure I'd have more requests. :D
     
    gford, Apr 24, 2005 IP
  3. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Haha, good luck. :)

    That seems to be the holy grail. Every php implementation I've seen of it is bassically illegal. I'm looking at cpp ATM.

    I'm gonna do it correctly or not at all.
     
    noppid, Apr 24, 2005 IP
  4. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I will soon need API access to get the following:

    Pass a key phrase to it, get the top N sites (probably 10-30) returned. Only need the URLs.

    Will that be possible with your class? (Also new to API usage...)
     
    T0PS3O, Apr 24, 2005 IP
  5. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #5
    The only thing I can't do with the Search API seems to be PR. Pretty much anything you can do on the search page is in the API though.

    I have the toolbar API and I'm looking at trying to hook php to cpp and go from there to pull page rank. I've never tried to system call with php this way, so I have a bit to learn yet.

    I'll play more next week, I'm back out to bikefest. Slept late and needed coffee so I dropped in for a few.
     
    noppid, Apr 24, 2005 IP
  6. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Cool. Make it do that for MSN and Yahoo as well and I might send you a PayPal donation...
     
    T0PS3O, Apr 24, 2005 IP
  7. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #7

    One API at a time. This is not exactly pleasurable reading. Well for a geek it may be. LOL

    But yes, the plan is all three.
     
    noppid, Apr 24, 2005 IP
  8. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #8
    T0PS3O, Apr 24, 2005 IP
  9. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #9
    Not much at all. I don't use all those setters and getters though ATM. I don't see the point of doing it in the class when he does no security processing at all. He's basically pre-setting parameters that are passed to the methods and grabbing them in the class Vs. passing them pre-cleaned/processed via the method call.

    This is not a difficult API to use at all.
     
    noppid, Apr 24, 2005 IP
  10. Cyber-SEO

    Cyber-SEO Member

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #10
    That's great stuff ;)

    I've got to find something like this for ASP.... hmmm maybe i'll start working on one of my own :)
     
    Cyber-SEO, Apr 27, 2005 IP
  11. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #11
    The one above is easy to use. Give it a try.
     
    noppid, Apr 27, 2005 IP
  12. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #12
    FYI. I had the google API working all along, but wanted to include page rank. However my code kept bombing. Turns out to be a server issue, the code actually works on my other servers.

    So anyway. I'm gonna try and put together a tool that will allow you to check a websites stats that you can run or your site to attract traffic.
     
    noppid, Jun 3, 2005 IP
  13. jlawrence

    jlawrence Peon

    Messages:
    1,368
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I'd be interested in taking a look at your API class.
    I've been using nusoap (php) and soap::lite (perl) and I'm have the devils own time getting correct results from site: searches. I'm 100% certain that I'm doing something wrong, but I don't know what.
    It's as if the site; results are all in the past (or only showing supplemental results).
    Anyone fancy helping me with some testing ? I need someone to run an api query for me (site:www.plymouthcricketclub.com) and show me the xml sent to G and what's returned.
    I'm convinced I've got a filter set somehow, but I can't see where.
     
    jlawrence, Jun 3, 2005 IP
  14. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #14
    The php api with nusoap is what I used. It's so simple, I was kinda taken back.

    I'll have to look at how I parse the XML. I'm sure I did it with basically the same array walk as I did in FREEBS. Nothing hitech.
     
    noppid, Jun 3, 2005 IP
  15. jlawrence

    jlawrence Peon

    Messages:
    1,368
    Likes Received:
    81
    Best Answers:
    0
    Trophy Points:
    0
    #15
    if you could run the site:www.plymouthcricketclub.com search and send me a copy of the xml being sent to G I'd be eternally greatful - assuming you get a estimatedTotalResultsCount return of >19
    I'd really like to get to the bottom of what I've got wrong with my scripts.
    I can PM you a copy of my script if you wish, as it's already setup to show the outgoing xml.
     
    jlawrence, Jun 3, 2005 IP
  16. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #16
    I don't know what ya mean by out going XML, I've never concerned myself with it to be honest.

    I'll pm you the page you can view the result I get.

    I'm using a little class I'm building that uses nusoap. I use a local wsdl file and then make the call with...

    doGoogleSearch($this->GKEY,$query,$start,$Max,$filter,$restrict,$safe,$lang,$ie,$oe);

    Hope that helps.
     
    noppid, Jun 3, 2005 IP
  17. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #17
    Following up on the PM.

    As we discussed, I too think this is a filter issue for the call. Do you have the API SDK?

    On the main page, APIs_Reference.html, there is a chart with a description for the passable parameters to the api calls. I think maybe restricts may be a part of the issue to.

    Just how to juggle them I aint sure, or for that matter aint sure if that's correct yet. :cool:
     
    noppid, Jun 3, 2005 IP
  18. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #18
    I found this sample...

    
    <?xml version='1.0' encoding='UTF-8'?>
    
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body>
        <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch" 
             SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
          <key xsi:type="xsd:string">00000000000000000000000000000000</key>
          <q xsi:type="xsd:string">shrdlu winograd maclisp teletype</q>
          <start xsi:type="xsd:int">0</start>
          <maxResults xsi:type="xsd:int">10</maxResults>
          <filter xsi:type="xsd:boolean">true</filter>
          <restrict xsi:type="xsd:string"></restrict>
          <safeSearch xsi:type="xsd:boolean">false</safeSearch>
          <lr xsi:type="xsd:string"></lr>
          <ie xsi:type="xsd:string">latin1</ie>
          <oe xsi:type="xsd:string">latin1</oe>
        </ns1:doGoogleSearch>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
    
    PHP:
     
    noppid, Jun 3, 2005 IP
  19. rspadi

    rspadi Guest

    Messages:
    60
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #19
    Can anyone point me to some code sources for Google API programming with .NET?

    Thanks.
     
    rspadi, Jun 7, 2005 IP
  20. Shoemoney

    Shoemoney $

    Messages:
    4,474
    Likes Received:
    588
    Best Answers:
    0
    Trophy Points:
    295
    #20
    maybe you should try the api root directory and not within the php thread =p
     
    Shoemoney, Jun 8, 2005 IP