Add a weather API to your Subsonic

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Add a weather API to your Subsonic

Postby rfunderburk » Tue Jan 24, 2012 4:40 pm

Clipboard01.jpg
To complete this mod:

Before we start you will need
-A text editor, I prefer Notepad ++
-Back up file "\subsonic\jetty\2361\webapp\WEB-INF\jsp\top.jsp" to a safe place

Open the file "\subsonic\jetty\2361\webapp\WEB-INF\jsp\top.jsp"
Locate this section (Line 22-29 using Notepad++):
Code: Select all
    <c:if test="${not model.musicFoldersExist}">
        <td style="padding-right:2em">
            <p class="warning"><fmt:message key="top.missing"/></p>
        </td>
    </c:if>

    <td>
        <table><tr align="center">


Now visit http://www.wunderground.com/ enter your location in the search section. I used my Zip Code and hit enter. Look for "Make this Location a Weather Sticker" click here. Choose your color & copy code.

Now go back to your editor (using Notepad++) paste (at line 30),
Code: Select all
<td style="min-width:4em;padding-right:0.5em">

and paste your code from wunderground, after pasting the "weather code" place
Code: Select all
</td>
which should be line 32.

Now your mod should look like this (line 30-32):
Code: Select all
            <td style="min-width:4em;padding-right:0.5em">
             <a href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=zmw:29566.1.99999&bannertypeclick=wu_macwhite"><img src="http://weathersticker.wunderground.com/cgi-bin/banner/ban/wxBanner?bannertype=wu_macwhite&airportcode=KCRE&ForcedCity=Little River&ForcedState=SC" alt="Click for Little River, South Carolina Forecast" height="40" width="100" /></a>
            </td>


I did change the code from wunderground to fit my top bar area better instead of using height="90" width="160", I used height="40" width="100". I have an older smaller monitor & found the button a nice addition, but some of the letters rather small. Ones of you with larger monitors can adjust for a better fit.

Now I opened the Subsonic Control Panel, and stopped the service. I saved the file "\subsonic\jetty\2361\webapp\WEB-INF\jsp\top.jsp".

Go back to the Subsonic Control Panel, and start the service.

Also I logged out & cleared my browers cache as well.

Now when I logged back into my subsonic I see the attached as it appears on the top bar.
rfunderburk
 
Posts: 7
Joined: Sat Jan 07, 2012 11:35 pm

Re: Add a weather API to your Subsonic

Postby rfunderburk » Tue Jan 24, 2012 4:42 pm

I should give credit for this idea to Qbix and the Youtube Mod 0.1 Bèta http://forum.subsonic.org/forum/viewtopic.php?f=8&t=8259
rfunderburk
 
Posts: 7
Joined: Sat Jan 07, 2012 11:35 pm

Re: Add a weather API to your Subsonic

Postby Richard Fearnhead » Sun Jan 29, 2012 11:37 pm

Nice mod!

Interested to know if it is possible to get this to work on a per user basis?
Richard Fearnhead
 
Posts: 10
Joined: Sat Jan 28, 2012 12:02 pm

Re: Add a weather API to your Subsonic

Postby rfunderburk » Mon Jan 30, 2012 1:50 pm

I plan on searching that out along with opening a new tab or page when clicking on the api. As it stands when someone clicks on the weather it will take them to the associate page at wunderground, which is unviewable due to the fact it attempts to display the page in the top 1/5 of the page.

I do think its possible, but I'm new to web page design. So if anyone has idea's feel free to share them.
rfunderburk
 
Posts: 7
Joined: Sat Jan 07, 2012 11:35 pm

Re: Add a weather API to your Subsonic

Postby lovs2build » Sat Jun 16, 2012 11:14 am

rfunderburk wrote:I plan on searching that out along with opening a new tab or page when clicking on the api. As it stands when someone clicks on the weather it will take them to the associate page at wunderground, which is unviewable due to the fact it attempts to display the page in the top 1/5 of the page.

I do think its possible, but I'm new to web page design. So if anyone has idea's feel free to share them.

First thanks for sharing this great mod. I kind of fixed the problem of "due to the fact it attempts to display the page in the top 1/5 of the page."
I added the target="_blank" tag now it opens in new tab/window. Hope this helps some else in the future. I added the code here as well..Take care!

<a

href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=zmw:00000.20.98329&b

annertypeclick=wu_blueglass" target="_blank"><img

src="http://weathersticker.wunderground.com/cgi-bin/banner/ban/wxBanner?bannertype=wu_bluegl

ass&airportcode=RPLC&ForcedCity=Cavite&ForcedState=" alt="Click for Cavite, Philippines

Forecast" height="40" width="100" /></a>
lovs2build
 
Posts: 4
Joined: Sat Jun 16, 2012 11:08 am


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 12 guests