Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Music according to local Weather #5

Closed
JdotCarver opened this issue Oct 5, 2015 · 5 comments
Closed

Dynamic Music according to local Weather #5

JdotCarver opened this issue Oct 5, 2015 · 5 comments
Labels
enhancement For improving the extension features help wanted

Comments

@JdotCarver
Copy link
Contributor

I have just received a mail from a user that wanted to help out. Hopefully we will be able to use this to implement the feature. Here is what he had to say:

"
It should be simple enough to use the OpenWeatherMap API (http://openweathermap.org/current) to periodically get the local weather for a city of the user's choice and determine whether to play sunny/rainy/snowy music. Granted the user can do it manually, but I think this would be a cute feature if it doesn't take much time to implement.

tl;dr of above link --

call http://api.openweathermap.org/data/2.5/weather?q=CityName&mode=xml 
and check precipitation.mode: "no" = sunny, "rain" = rainy, "snow" = snowy.

"

and then you'd need to make it change the value of option.music in:

// get path of a song file
function setAudioUrl(file) {
    if (checkKK()) {
        currentMusic = 'kk';
    }
    else {
        currentMusic = options.music;
        file += 'm';
    }
    audio.src = '../' + currentMusic + '/' + file + '.ogg';
}

to switch weather music type and BAM.

@JdotCarver JdotCarver added enhancement For improving the extension features help wanted labels Oct 5, 2015
@ghost
Copy link

ghost commented Nov 13, 2015

Any luck figuring this out since this post?

@GammaGames
Copy link
Contributor

I did some work here: 4af9cd9, it seems to be working but it still needs more testing
I'm still new to git so I'm unsure how to reference issues when I commit

edit: It fetches the weather fine but isn't storing it for use getting the current music. Gotta work on it a little more

edit2: I used a timeout to force a music restart after the weather was fetched and it appears to be working. I'll might fork kylechu's and add the features, his OOP format will be much nicer to work with in the future

edit3: Have succesfully updated to the OOP format

@JdotCarver
Copy link
Contributor Author

And his format is now merged. :)

@navarr
Copy link

navarr commented Sep 16, 2019

I see this has been merged - has it been released? I can't find the option

@JdotCarver
Copy link
Contributor Author

Yeah unfortunately I lack the knowledge and we lack the manpower to merge all commits and ensure proper support of the extension. So I'd rather have it all on git hub where savvier people can do what they please with it and let the stable version sit on the Chrome Store. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For improving the extension features help wanted
Development

No branches or pull requests

3 participants