Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9034919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:37:05+00:00 2026-06-16T08:37:05+00:00

i want to make an 2 legged oauth yql request with php. So far:

  • 0

i want to make an 2 legged oauth yql request with php.
So far:

// Include the PHP SDK.
include_once("yosdk/lib/Yahoo.inc");

// Define constants to store your API Key (Consumer Key) and
// Shared Secret (Consumer Secret).
define("API_KEY","her_comes the key");
define("SHARED_SECRET","here_comes_the_secret");

$two_legged_app = new YahooApplication(API_KEY,SHARED_SECRET);

$stock_query =  "elect * from ......";

$stockResponse = $two_legged_app->query($stock_query);
var_dump($stockrResponse);

But the problem is, that i dont want to query the command line….. i just want to oauth with the api key i got and use the url directly i got of the command when i typed in yql….

like this:

$url='http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20('+url_stocks+')&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys';

(i edited the url that came out my wishes for).Please dont ask why i dont use the command to query (long story). i would be pleased by getting some help.
thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:37:06+00:00Added an answer on June 16, 2026 at 8:37 am

    solved it:

    http://code.google.com/p/oauth-php/wiki/ConsumerHowTo

    include_once “oauth/library/OAuthStore.php”;
    include_once”oauth/library/OAuthRequester.php”;

    $key_1 = “your_key”; $secret_1 = “your_secret”;

    $ticks=”%22AAPL%22%2C%22MSFT%22″;

    $options = array( ‘consumer_key’ => $key_1, ‘consumer_secret’ =>
    $secret_1 ); OAuthStore::instance(“2Leg”, $options );

    $url =
    “http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(‘$ticks’)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys”;
    // this is the URL of the request $method = “GET”; // you can also use
    POST instead $params = null;

    try {
    // Obtain a request object for the request we want to make
    $request = new OAuthRequester($url, $method, $params);
    // Sign the request, perform a curl request and return the results,
    // throws OAuthException2 exception on an error
    // $result is an array of the form: array (‘code’=>int, ‘headers’=>array(), ‘body’=>string)
    $result = $request->doRequest();

        $response = $result['body'];
        $resp_array=json_decode($response,TRUE);
        echo $resp_array['query']['results']['quote'][1]['symbol']; // MSFT
    

    } catch(OAuthException2 $e) { }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i want to make system website like yahoo messenger using PHP. here the
I want to make a http post to an outside url using php. By
I want make datetimepicker in my project. Using jquery how it is possible? I
I want make a bash script which returns the position of an element from
I want make interactive application where user launches it and can do various task
Let's say I want make some of my sources publicly available via my blog
I am new android app developer i want make app for tablets and phone
I have style sheet with a class name changebackgroundcolor i want make change in
Sorry google translate make mistake, to many mistake, i want make an alarm in
I am traversing a HTML document using javascript DOM. I want make a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.