Yahoo Weather API no longer working in Weather portlet

251 views
Skip to first unread message

Lauren Anderson

unread,
Mar 25, 2016, 3:13:23 PM3/25/16
to uporta...@apereo.org
How is everyone else dealing with the Yahoo Weather API now requiring OAuth1?


It was implemented March 15, 2016, but we just noticed yesterday that our Weather portlet returns nothing and the error in the log is:

WARN  [uP-PortletExec-2105-guest-RENDER-[provo-weather]] o.a.c.httpclient.HttpMethodDirector 2016-03-25 00:00:37,821 - Unable to respond to any of these challenges: {oauth=OAuth oauth_problem="OST_OAUTH_PARAMETER_ABSENT_ERROR", realm="yahooapis.com"}

WARN  [uP-PortletExec-2105-guest-RENDER-[provo-weather]] o.j.p.w.p.WeatherViewController 2016-03-25 00:00:37,830 - Failed to load weather for SavedLocation [code=12794266, name=Provo, temperatureUnit=F]

org.springframework.dao.DataRetrievalFailureException: get of 'http://weather.yahooapis.com/forecastrss?w=12794266&u=f' failed with status '401' due to 'Unauthorized'


There must have been a grace period.  Any suggestions?

Lauren Anderson
Brigham Young University

Tim Levett

unread,
Mar 25, 2016, 3:27:41 PM3/25/16
to Lauren Anderson, uporta...@apereo.org

Hi Lauren,


We are using the World Weather Online API with the Weather Portlet at UW-Madison. They do limit you to a specific quota but we have never came close to it because of the caching we do in the Weather Portlet app.


Hope that helps,


Tim Levett
MyUW-Infrastructure


From: uporta...@apereo.org <uporta...@apereo.org> on behalf of Lauren Anderson <laur...@byu.edu>
Sent: Friday, March 25, 2016 2:12 PM
To: uporta...@apereo.org
Subject: [uportal-user] Yahoo Weather API no longer working in Weather portlet
 
--
You received this message because you are subscribed to the Google Groups "uPortal Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uportal-user...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/uportal-user/.

James Wennmacher

unread,
Mar 25, 2016, 4:21:19 PM3/25/16
to uporta...@apereo.org
Hi Tim,

Have you updated the portlet?  I heard it was failing with World Weather Online because of an API version mismatch (v1 URL now not valid).  I was going to be updating it to the v2 URL fairly soon because I heard that might work.
James Wennmacher - Unicon
480.558.2420

Tim Levett

unread,
Mar 28, 2016, 9:50:38 AM3/28/16
to James Wennmacher, uporta...@apereo.org

Hi James,


We have not. We are using the jasig/WeatherPortlet. Seems to work just fine for us. Is there a EOL on v1 or something? We are subscribed to the email list with the free api and we haven't seen anything.


- Tim




James Wennmacher

unread,
Mar 28, 2016, 12:26:18 PM3/28/16
to Tim Levett, uporta...@apereo.org
I haven't tried it yet but there was a report in the Zendesk from SDSU that they tried to use the Weather Portlet and when they added their key and the portlet tried the URL  http://api.worldweatheronline.com/free/v1/weather.ashx?key=(...) it failed with an HTTP403 error but if they changed from v1 to v2 in the URL they got weather data back.

I was going to investigate this perhaps today.  If you are using it successfully in prod that is interesting.

James Wennmacher - Unicon
480.558.2420

James Wennmacher

unread,
Mar 29, 2016, 2:37:27 PM3/29/16
to uporta...@apereo.org
Hi Lauren,

Thanks for reporting this.  I created https://issues.jasig.org/browse/WPT-81.  Do you or someone else have time to try and fix the Yahoo integration?

FYI I glanced at World Weather Online API. They have a free API but at the moment when you register you get an API key for a 60-day trial of Premium. The premium API key requires a different URL which the portlet doesn't support.  I did not see a way to get a free API key but if you find a way please let us know.

James Wennmacher - Unicon
480.558.2420
On 03/25/2016 12:27 PM, Tim Levett wrote:

Lauren Anderson

unread,
Mar 29, 2016, 3:07:44 PM3/29/16
to James Wennmacher, uporta...@apereo.org
Thanks for doing that. I am already working on it. Once it’s done, I’ll let you know and see about creating a pull request.

Lauren

Bruce Phillips

unread,
Apr 14, 2016, 10:08:41 AM4/14/16
to uPortal Community
Just wondering if there is an update on the problems with using the weather portlet.

We want to add the Weather portlet to our portal but have the same issue James reported - neither the Yahoo or World Weather Online integrations works.

Bruce
University of Kansas


On Tuesday, March 29, 2016 at 1:37:27 PM UTC-5, James Wennmacher wrote:
Hi Lauren,

Thanks for reporting this.  I created https://issues.jasig.org/browse/WPT-81.  Do you or someone else have time to try and fix the Yahoo integration?

FYI I glanced at World Weather Online API. They have a free API but at the moment when you register you get an API key for a 60-day trial of Premium. The premium API key requires a different URL which the portlet doesn't support.  I did not see a way to get a free API key but if you find a way please let us know.
James Wennmacher - Unicon
480.558.2420
On 03/25/2016 12:27 PM, Tim Levett wrote:

Hi Lauren,


We are using the World Weather Online API with the Weather Portlet at UW-Madison. They do limit you to a specific quota but we have never came close to it because of the caching we do in the Weather Portlet app.


Hope that helps,


Tim Levett
MyUW-Infrastructure



Sent: Friday, March 25, 2016 2:12 PM
To: uporta...@apereo.org
Subject: [uportal-user] Yahoo Weather API no longer working in Weather portlet
How is everyone else dealing with the Yahoo Weather API now requiring OAuth1?


It was implemented March 15, 2016, but we just noticed yesterday that our Weather portlet returns nothing and the error in the log is:

WARN  [uP-PortletExec-2105-guest-RENDER-[provo-weather]] o.a.c.httpclient.HttpMethodDirector 2016-03-25 00:00:37,821 - Unable to respond to any of these challenges: {oauth=OAuth oauth_problem="OST_OAUTH_PARAMETER_ABSENT_ERROR", realm="yahooapis.com"}

WARN  [uP-PortletExec-2105-guest-RENDER-[provo-weather]] o.j.p.w.p.WeatherViewController 2016-03-25 00:00:37,830 - Failed to load weather for SavedLocation [code=12794266, name=Provo, temperatureUnit=F]

org.springframework.dao.DataRetrievalFailureException: get of 'http://weather.yahooapis.com/forecastrss?w=12794266&u=f' failed with status '401' due to 'Unauthorized'


There must have been a grace period.  Any suggestions?

Lauren Anderson
Brigham Young University

--
You received this message because you are subscribed to the Google Groups "uPortal Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uportal-user...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/uportal-user/.

Lauren Anderson

unread,
Apr 14, 2016, 1:36:17 PM4/14/16
to uporta...@apereo.org
I’ve been busy with (non-Weather-portlet) work but here’s what I have so far:

Yahoo still has a public API that doesn't require OAuth1 but it’s a different endpoint that uses the Yahoo Query Language (YQL) and the result it returns is in a different format which would require changing quite a bit of code. The rate limit is 2,000 calls per hour.  Here’s a sample of what it looks like:

paste into browser address:


or use curl from terminal window:

curl https://query.yahooapis.com/v1/public/yql -d q='select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=“denver, co")' -d format=Jon

To use the one currently in the Weather portlet now, for example http://weather.yahooapis.com/forecastrss?w=2391279&u=f, requires OAuth1, which is a multi-step process:

-Create a Yahoo user account.

1. Sign up for a Yahoo API key by creating an app on Yahoo Developer Network (YDN) with at least “Contacts” permissions and with a callback web address (which can also be a dummy address) to get a consumer key and secret.

2. Use the consumer key and secret generated in step 1 to get a request token, request token secret, and a URL for authenticating.

3. Use the URL provided in step 2 to sign in to Yahoo in a browser and authenticate with your username and password. After authenticating, it will redirect to the callback web address you provided in step 1 with a couple parameters: u_oauth_token and u_oauth_verifier.  Signing in with a browser and verifying must be done at least once but is not necessary after that as long as you hang on to the access token, secret, and session handle that will be generated in the next step to refresh an expired access token.

4. Use the consumer key and secret from step 1, the request token and request token secret from step 2 and the u_oauth_verifier from step 3 to get an access token (oauth_token), access token secret (oauth_token_secret), and session handle (oauth_session_handle), which is good for only 1 hour.  (After an hour it will be need to be refreshed using the consumer key and secret from step 1 and the expired access token, secret, and session handle.)

5. Call the Yahoo RSS Weather service with the consumer key and secret from step 1 and the access token and secret from step 4.

Then problem here is that you have to refresh the access token every hour.  The benefit is that the data format is the same as before and you can access it more times.  I’m not sure if it falls under the same rate limitations as using YQL, which is 2,000 calls per hour for the public URL and 20,000 calls per hour (limited to 100,000 per day) for the private OAuth1 URL.

I’m working on initially just including Oauth1 code in the Weather portlet using the forecasterss URL that we currently use.  Ultimately, it would be helpful to use the YQL url and handle the data as JSON.

Yahoo Developer Network YDN: https://developer.yahoo.com/
Yahoo Query Language (YQL): https://developer.yahoo.com/yql/
Yahoo YQL usage limits: https://developer.yahoo.com/yql/faq/

Note: many of the Yahoo developer websites are slow and sometimes fail to display. You may have to refresh the page several times to get it to display. I suggest that once it does, copy it locally to safe frustration.


Lauren

From: <uporta...@apereo.org> on behalf of Bruce Phillips <bruceap...@gmail.com>
Date: Thursday, April 14, 2016 at 8:08 AM
To: "uporta...@apereo.org" <uporta...@apereo.org>
Reply all
Reply to author
Forward
0 new messages