Loading ...
Sorry, an error occurred while loading the content.

query

Expand Messages
  • kovalsonlucien
    I am new using the ysearchboss with python: the authentification oauth works fine I use the url with the query word steve url =
    Message 1 of 4 , Oct 16, 2011
    • 0 Attachment
      I am new using the ysearchboss with python:

      the authentification oauth works fine
      I use the url
      with the query word"steve"
      url = 'http://yboss.yahooapis.com/ysearch/limitedweb?q=steve&format=xml&abstract=long&start='+str(0)+'&count='+str(50)
      It works well. Everything is OK

      1 if I want to change "steve" in "steve job" following the doc
      url = 'http://yboss.yahooapis.com/ysearch/limitedweb?q="steve job"&format=xml&abstract=long&start='+str(0)+'&count='+str(50)

      2 if I want to mix two words steve an ipag
      with ?q=steve AND ipad... It fails again!

      It does not work!
      I dont understand the mistake.


      the detailed code is

      consumer=oauth2.Consumer(key=OAUTH_CONSUMER_KEY,secret=OAUTH_CONSUMER_SECRET)
      params = {
      'oauth_version': '1.0',
      'oauth_nonce': oauth2.generate_nonce(),
      'oauth_timestamp': int(time.time()),
      }

      oauth_request = oauth2.Request(method='GET', url=url, parameters=params)
      oauth_request.sign_request(oauth2.SignatureMethod_HMAC_SHA1(), consumer, None)
      oauth_header=oauth_request.to_header(realm='yahooapis.com')
      # Get search results
      http = httplib2.Http()
      resp, content = http.request(url, 'GET', headers=oauth_header)



      Thanks
      Lucien
    • kovalsonlucien
      I dont understand the fault in the query! I am new using the ysearchboss with python: the authentification oauth works fine I use the url with the query
      Message 2 of 4 , Oct 17, 2011
      • 0 Attachment
        I dont understand the fault in the query!

        I am new using the ysearchboss with python:

        the authentification oauth works fine
        I use the url
        with the query word"steve"
        url =
        'http://yboss.yahooapis.com/ysearch/limitedweb?q=steve&format=xml&abstract=long&\
        start='+str(0)+'&count='+str(50)
        It works well. Everything is OK

        1 if I want to change "steve" in "steve job" following the doc
        url = 'http://yboss.yahooapis.com/ysearch/limitedweb?q="steve
        job"&format=xml&abstract=long&start='+str(0)+'&count='+str(50)

        2 if I want to mix two words steve an ipag
        with ?q=steve AND ipad... It fails again!

        It does not work!
        I dont understand the mistake.


        the detailed code is

        consumer=oauth2.Consumer(key=OAUTH_CONSUMER_KEY,secret=OAUTH_CONSUMER_SECRET)
        params = {
        'oauth_version': '1.0',
        'oauth_nonce': oauth2.generate_nonce(),
        'oauth_timestamp': int(time.time()),
        }

        oauth_request = oauth2.Request(method='GET', url=url, parameters=params)
        oauth_request.sign_request(oauth2.SignatureMethod_HMAC_SHA1(),
        consumer, None)
        oauth_header=oauth_request.to_header(realm='yahooapis.com')
        # Get search results
        http = httplib2.Http()
        resp, content = http.request(url, 'GET', headers=oauth_header)
      • Rahul Hampole
        Hello, I am not an expert in Python but my sense is the problem is happening because the query is not being encoded. Query should be encoded in UTF-8 format
        Message 3 of 4 , Oct 17, 2011
        • 0 Attachment

          Hello,

          I am not an expert in Python but my sense is the problem is happening because the query is not being encoded.

           

          Query should be encoded in UTF-8 format for it to work correctly.

           

          Best

          Rahul

           

           

          From: ysearchboss@yahoogroups.com [mailto:ysearchboss@yahoogroups.com] On Behalf Of kovalsonlucien
          Sent: Monday, October 17, 2011 8:55 AM
          To: ysearchboss@yahoogroups.com
          Subject: [ysearchboss] query

           

           



          I dont understand the fault in the query!

          I am new using the ysearchboss with python:

          the authentification oauth works fine
          I use the url
          with the query word"steve"
          url =
          'http://yboss.yahooapis.com/ysearch/limitedweb?q=steve&format=xml&abstract=long&\
          start=
          '+str(0)+'&count='+str(50)
          It works well. Everything is OK

          1 if I want to change "steve" in "steve job" following the doc
          url = 'http://yboss.yahooapis.com/ysearch/limitedweb?q="steve
          job"&format=xml&abstract=long&start='+str(0)+'&count='+str(50)

          2 if I want to mix two words steve an ipag
          with ?q=steve AND ipad... It fails again!

          It does not work!
          I dont understand the mistake.

          the detailed code is

          consumer=oauth2.Consumer(key=OAUTH_CONSUMER_KEY,secret=OAUTH_CONSUMER_SECRET)
          params = {
          'oauth_version': '1.0',
          'oauth_nonce': oauth2.generate_nonce(),
          'oauth_timestamp': int(time.time()),
          }

          oauth_request = oauth2.Request(method='GET', url=url, parameters=params)
          oauth_request.sign_request(oauth2.SignatureMethod_HMAC_SHA1(),
          consumer, None)
          oauth_header=oauth_request.to_header(realm='yahooapis.com')
          # Get search results
          http = httplib2.Http()
          resp, content = http.request(url, 'GET', headers=oauth_header)

        • Luis Siquot
          the space betwen steve and jobs must be encoded as + (plus) or %20 I do not remember which of this two but sure, not the space. Luis 2011/10/17
          Message 4 of 4 , Oct 17, 2011
          • 0 Attachment
            the space betwen steve and jobs must be encoded as + (plus) or %20   I do not remember which of this two but sure, not the space.

                Luis


            2011/10/17 kovalsonlucien <kovalsonlucien@...>


            I dont understand the fault in the query!

            I am new using the ysearchboss with python:

            the authentification oauth works fine
            I use the url
            with the query word"steve"
            url =
            'http://yboss.yahooapis.com/ysearch/limitedweb?q=steve&format=xml&abstract=long&\
            start='+str(0)+'&count='+str(50)
            It works well. Everything is OK

            1 if I want to change "steve" in "steve job" following the doc
            url = 'http://yboss.yahooapis.com/ysearch/limitedweb?q="steve
            job"&format=xml&abstract=long&start='+str(0)+'&count='+str(50)

            2 if I want to mix two words steve an ipag
            with ?q=steve AND ipad... It fails again!

            It does not work!
            I dont understand the mistake.


            the detailed code is

            consumer=oauth2.Consumer(key=OAUTH_CONSUMER_KEY,secret=OAUTH_CONSUMER_SECRET)
            params = {
            'oauth_version': '1.0',
            'oauth_nonce': oauth2.generate_nonce(),
            'oauth_timestamp': int(time.time()),
            }

            oauth_request = oauth2.Request(method='GET', url=url, parameters=params)
            oauth_request.sign_request(oauth2.SignatureMethod_HMAC_SHA1(),
            consumer, None)
            oauth_header=oauth_request.to_header(realm='yahooapis.com')
            # Get search results
            http = httplib2.Http()
            resp, content = http.request(url, 'GET', headers=oauth_header)




            ------------------------------------

            Yahoo! Groups Links

            <*> To visit your group on the web, go to:
               http://groups.yahoo.com/group/ysearchboss/

            <*> Your email settings:
               Individual Email | Traditional

            <*> To change settings online go to:
               http://groups.yahoo.com/group/ysearchboss/join
               (Yahoo! ID required)

            <*> To change settings via email:
               ysearchboss-digest@yahoogroups.com
               ysearchboss-fullfeatured@yahoogroups.com

            <*> To unsubscribe from this group, send an email to:
               ysearchboss-unsubscribe@yahoogroups.com

            <*> Your use of Yahoo! Groups is subject to:
               http://docs.yahoo.com/info/terms/


          Your message has been successfully submitted and would be delivered to recipients shortly.