WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Runners Log] Weather integration (63 posts)

  1. TheRealEyeless
    Member
    Posted 4 years ago #

    From frold, original thread

    Regarding weather:
    I thought about a integration of the Weather Posting Plugin found herE: http://wordpress.org/extend/plugins/weather-postin/ This way weather data is automaticly inserted in a new post ;)

    The problem is I wasnt able to get it to work for eg. Denmark, where I live. I should have weather data for all countries - but I wasnt able to fix it :S

    This blog is using it when there is posted in the Categori: Runners Log: http://wannaberunner.com/ See the end of every post where you find data like:

    Weather conditions during run:

    * Temperature: 76°F;
    * Humidity: 87%;
    * Heat Index: 75°F;
    * Wind Chill: 76°F;
    * Pressure: 30.04 in.;

  2. TheRealEyeless
    Member
    Posted 4 years ago #

    ok, after my first exam in about two hours I will give it a try to set it up, I will post progress here ;)

    Cheers Eyeless

  3. frold
    Member
    Posted 4 years ago #

    Cool - looking forward to that...

    As I remember there are some issues regarding that plug.

    First it use a rss path like this:
    $url = 'http://www.rssweather.com/zipcode/' . $zip_code . '/rss.php';

    $zip_code doesnt support danish zip-codes.

    and eg the path to the weather for Odense, Denmark, where I live is:
    http://www.rssweather.com/wx/dk/odense/rss.php

    But eg. you are able to snip the data from a path file like this
    http://www.rssweather.com/hw3.php?place=berlin-tegel&state=&country=de&utm_source=rss&utm_medium=rss

    Second there is a database issue
    The plugin stores that weather data in its own database table post_weather and dont think taht is the best way to store data.

    What do you think?

  4. TheRealEyeless
    Member
    Posted 4 years ago #

    ok, I set up an xampp enviroment for testing...quite funny, regarding to permission problems it took me three hours till wordpress was up and running.

    With the weather plugin I have the same problem here, there is no way to retrieve my data. I tried some other plugins but outside the US it seems to be quite a problem.

    I'll give some of them a try this weekend....unfortunatelly I still have to do some preparations for my exams :-(

    Cheers Eyeless

  5. frold
    Member
    Posted 4 years ago #

    Exams have first priority :D

    This is just for fun - your study is your future...

    But Im very glad you want to give something back to this plugin...

  6. TheRealEyeless
    Member
    Posted 4 years ago #

    Sure it is and that are my prioritys, but some of my free time left can be spent here ;) ... since I need and use this running log ;)

  7. TheRealEyeless
    Member
    Posted 4 years ago #

    Looks to be a bit nasty, since mostz plugins are outated or just for the use in the US. What do you think about using the Google Weather API ?
    see: http://www.freecomputeradvice.net/2009/08/google-weather-api.html

    Cheers Eyeless

  8. frold
    Member
    Posted 4 years ago #

    I didnt know they had one :D

    I guess: if its google it will not be outdated soon :)

    Could be a very good alternative and easy to use:

    This city was easy to find:

    http://www.google.com/ig/api?weather=odense :)

    Then you could mix it with the setting: meters versus english

    if meters then celcius else you have fahrenheit

    Great link API found :D

  9. TheRealEyeless
    Member
    Posted 4 years ago #

    Then you could mix it with the setting: meters versus english

    if meters then celcius else you have fahrenheit

    That's a cool idea, I'll have a look at it this afternoon and start trying to integrate it!

    Cheers Eyeless

  10. frold
    Member
    Posted 4 years ago #

    Im looking forward to see if you're able to fix it :D

  11. TheRealEyeless
    Member
    Posted 4 years ago #

    ok, right now I am getting all information from Google I need, currently checking the WP Plugin API and the official Writing a Plugin Site to get in touch with integrating it correctly.
    Since I am most time learning for my exams I think first usable version will be up at friday ;)

    Currently I am not sure wheter it is good to uses miles if a City is choosen in a country where miles are a standard way of measuring disatnces. Since I am also running in other towns this would mean if I take part at a running competition in GB the DB mixes my km and miles run (not sooo got ;) ). But I will think about a solution for this ;)

    Cheers Eyeless

    btw: do we want pictures showing the weather or just data?

  12. frold
    Member
    Posted 4 years ago #

    I dont think the place should decide if its fahrenheit or celcius - it should be the user.

    If the user choose english - inches and pound - Im pretty sure the user also want it to be in fahrenheit.....

    Picture or not a picture - maybe there could be a to new fields in runners log admin

    Weather
    -Show text
    -Show image

    Then the user coulde chooser if he/she want one of it or both...

    What do you think?

  13. TheRealEyeless
    Member
    Posted 4 years ago #

    If the user choose english - inches and pound - Im pretty sure the user also want it to be in fahrenheit.....

    ok, now I got, think thats no problem, maybe implement this as the default setting but I would nevertheless provide an option in the menu for changing it.

    Weather
    (...)
    Then the user coulde chooser if he/she want one of it or both...

    Yes sound good, but at first I am going to bring text mode up and running ;)

    Cheers Eyeless

  14. frold
    Member
    Posted 4 years ago #

    There is a new version for testing ;)

    What do you think - so far?

    oops should have been in the gear-post - please reply in that one :)

  15. TheRealEyeless
    Member
    Posted 4 years ago #

    did it ;)

    I have encountered a little problem here corresponding the Google API. Since the API is not official I think we should not use it (see this google posting ). But I found another API providing nearly the same data at yahoo . The Yahoo API is for free but we have to tell while using it from whom we got the weather data (I am currently thinking of a way to integrate some notation for that, maybe it is possible to add some information about yahoo in the footer of a blog using the plugin with weather data)

    What do you think about it ?

    Cheers Eyeless

  16. frold
    Member
    Posted 4 years ago #

    It's up to you.

    I think the google API seems more straightforward to use.

    But if you're able to solve it with the yeahoo then feel free :D

    Regarding adding content to the footer I think you can use:

    add_action('wp_footer','function-name');
  17. TheRealEyeless
    Member
    Posted 4 years ago #

    ok, thanks, but I have some new information here. Since I didn't want to mention Yahoo in everey single blog entry, I wrote an email to Yahoos developement center two days ago when I found the API. In this mail I asked whether it would be enough to mention yahoo when a new blog entry is entered and in the configuration panel (In my opinion both is obvous since I need to enter the address for each blog entry and I can activate weather data in the admin area) and not to show it in every blog entry.
    And some minutes ago I received the answer and I can do it this way :-)

    Cheers Eyeless

  18. frold
    Member
    Posted 4 years ago #

    Nice research :D

  19. TheRealEyeless
    Member
    Posted 4 years ago #

    Sorry for getting off so fast earlier, but I was a bit in a hurry :/

    I put up a developement version online, now there is a point weather settings where you can insert your WOEID. Depending on this all information is queried from Yahoo (and shown below).

    Next to tis it is possible to activate and deactivate temperature for each run in the metabox...this is also luckily working.

    Next steps would be to set the used unit corresponding to the selected units in admin, Miles->Fahrenheit, Meters->Celsius. And to show the user what the system thinks what the temperature is currently.

    Cheers Eyeless

  20. TheRealEyeless
    Member
    Posted 4 years ago #

    Ok, Unit-fun is working :)

    Cheers Eyeless

  21. frold
    Member
    Posted 4 years ago #

    Cool the admin seems to work perfect I get:

    city: Odense
    humidity: 83%
    wind chill: 18
    wind direction: 190
    wind speed: 14.48
    temperature: 18
    weather: Mostly Cloudy

    I dont know if this is bug or not?

    If you first set your WOEID and go to Runners Log Setting and Enable "Enable Temperature Measurement" it delete the WOEID ...

    IF we want temperature to be auto-enabled when the user installs the plugin you can add it to: function runnerslog_activate in runnerslog.php

  22. TheRealEyeless
    Member
    Posted 4 years ago #

    If you first set your WOEID and go to Runners Log Setting and Enable "Enable Temperature Measurement" it delete the WOEID ...

    That's a bug, I will have a closer look at saving options. Since the temperature checkbox in the admin panel and the weather settings aren't connected I think that I am missing something for storing.

    IF we want temperature to be auto-enabled when the user installs the plugin you can add it to: function runnerslog_activate in runnerslog.php

    Ah ok, I think we should do this, but get it ready first ;)

    Cheers Eyeless

  23. frold
    Member
    Posted 4 years ago #

    Take your time - it was not criticism, it was just a bug I find when I tried to test it...

    Keep up the good work..

    Another thought. Should the weather data be in the meta-box as the other date or should it be in the footer of the post like the weather postin' plugin?

    What is your plan?

  24. TheRealEyeless
    Member
    Posted 4 years ago #

    (...)it was not criticism, it was just a bug I find when I tried to test it...

    It's absolutely ok, I am not offended! I am happy that you found this bug, since I wouldn't at this time ;)

    Another thought (...)

    I would put it in the metabox, since then I think it's easier to aggregate the information (maybe it's possible to gain the perfect temperature for training if comparing runs and temperature or sth. like that....) and currently it's the only way I know to save it to a certain blogpost ;)

    Would you prefer it in another way? (I currently don't see any real advantage in neither of this two variants)

    Cheers Eyeless

  25. frold
    Member
    Posted 4 years ago #

    We can start having it in the metabox :D

    Im at #wordpress if you have time and I need help :D ...

  26. TheRealEyeless
    Member
    Posted 4 years ago #

    ok, WOEID is now being saved, finally I got how this DB is working ^^

    May you verify that?

    Cheers Eyeless

  27. TheRealEyeless
    Member
    Posted 4 years ago #

    Ok did some redesign at the weather options. Currently I just designed the backend but my idea is the following:

    You can adjust what shall appear in the metabox for each post and activate seperately the Yahoo Weather which may insert values for each weather field.

    What do you think?

    Cheers Eyeless

  28. frold
    Member
    Posted 4 years ago #

    Yeah, it saves the WOEID and some times not...

    Eg if you set in a WOEID and saves it. Return to the runnerslog setting and "Enable Weather Measurement" the data is saved. But it is deleted again if you want to:

    Enable Temperature Measurement
    Enable Windchill Measurement
    Enable Humidity Measurement
    Enable Textbased Weather Description
    Enable Weather Data from Yahoo

    And dont put in a WOEID when you are enabling the above... Do you get the same result?

    Regarding your redesign and idea I like it :D

  29. TheRealEyeless
    Member
    Posted 4 years ago #

    yes, I think the problem is that you unsed it. I mean if you enter no WOEID it sets WOEID = "", I think I will just enter the current WOEID in this field when entering the weather settings.
    Thanks for testing, :)

    Cheers Eyeless

  30. frold
    Member
    Posted 4 years ago #

    Seems like a solution! :)

Topic Closed

This topic has been closed to new replies.

About this Topic