Created
May 12, 2019 12:16
-
-
Save osde8info/caee283fe3c78b09d5542299bda4bfbd to your computer and use it in GitHub Desktop.
yahoo api node oauth example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require('secrets'); | |
var OAuth = require('oauth'); | |
var request = new OAuth.OAuth( | |
null, | |
null, | |
MyKey, | |
MySecret, | |
'1.0', | |
null, | |
'HMAC-SHA1', | |
null, | |
{ | |
"X-Yahoo-App-Id": MyAppid | |
} | |
); | |
request.get( | |
'https://weather-ydn-yql.media.yahoo.com/forecastrss?location=brighton,uk&format=json', | |
null, | |
null, | |
function (err, data, result) { | |
if (err) { | |
console.log(err); | |
} else { | |
console.log(data) | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
adapted from https://gist.github.com/VerizonMediaOwner/40e8edccaab25e2b3b5001d2ecc1d070