INTRODUCTION
------------
Open Weather is a module to parse out the weather response from openweathermap.org. The main reason we need this module because Google had killed it's weather API, thus rendering the Google Weather module useless. This module is a nice way for users to get weather in their site now.
MODULE DETAILS
--------------
Open weather has a few nice features.
* It can handle unlimited cities for weather output. Each city will have it's own block which can be customised to show whatever weather details you see fit. You can even theme this yourself by overriding the theme that comes with the module.
* It also provides the token option of users so that you can make use of their location.
* It also shows the forecast on hourly basis with 3 hours of interval.
* It also provides the data for daily forecast in your site, or simply display the data anyway you want.
RECOMMENDED MODULES
-------------------
* TOKEN (https://www.drupal.org/project/token)
When enabled user tokens would be available in as an input value for the selected input option for open weather block.
CONFIGURATION
-------------
* The APPID which is required to make use of this module can be get from openweathermap.org and it is configurable and corresponding configuration settings are available at admin/config/services/openweather. Enter your APPID over here and if the APPID entered is wrong you can get an error which you can see under dblog.
* To use this module you go to admin/structure/block and click on place block where you find a block called Open Weather Block.
* You can get the weather status using following types of input field.
City name
City Id
Zip Code
Geographic Coordinates
Select any one of the input option and place the value corresponding to selected input option in text field.
* You can also take the details of current user and make use of it for that you need to add the field under admin/config/people/accounts/fields for the users.
* If Token module exists then you can make use of the details stored for the user and place the token in text field for example: if you have added a field called city name for an user and if data is stored for that user then you can find that token available under current user menu and you can place a placeholder like [current-user:field_city_name] where field_city_name is the machine name of the field created for the user.
* There is an option for the number of count which is applicable for two condition either you want to display the forecast for hourly basis or daily basis. In case of hourly forecast maximum value should be 36 and in case of daily forecast maximum value should be 7.
* You can select an option for what kind of data you want to display like current weather detail or forecast.
* You can also select all types of data you want to display in that block and it is configurable.
* Warning Message to be shown, if the text field or count field will be empty.
Project Page: https://www.drupal.org/sandbox/prashant114606/2839644
Git Url:
git clone --branch 8.x-1.x https://git.drupal.org/sandbox/prashant114606/2839644.git openweather
cd openweatherManual reviews of other projects
- Nodeinfo : https://www.drupal.org/node/2839903#comment-11871333
- Autocomplete Node Search : https://www.drupal.org/node/2843493#comment-11871571
- Media entity Pinterest : https://www.drupal.org/node/2841662#comment-11871930
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | Screenshot from 2016-12-28 22-59-32.png | 56.38 KB | visabhishek |
| Screen Shot 2016-12-27 at 1.24.46 pm.png | 229 KB | prashant114606 |
Comments
Comment #2
prashant114606 commentedComment #3
prashant114606 commentedComment #4
visabhishek commentedComment #5
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxprashant114606283964...
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6
visabhishek commentedModule is not working for me
I am getting "GuzzleHttp\Exception\ClientException: Client error: `GET http://api.openweathermap.org/data/2.5/weather?appid=15893c78d7f435f4908...` resulted in a `401 Unauthorized` response: {"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."} in GuzzleHttp\Exception\RequestException::create() (line 107 of /var/www/html/drupal-8/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php)." Error.
Please see the screenshot
Comment #7
prashant114606 commentedComment #8
prashant114606 commentedHi visabhishek, thanks for giving your time to review this module. I have done the needful changes and putting it in needs review state.
Comment #9
prashant114606 commentedComment #10
navneet0693 commentedFile : WeatherBlock.php
76
'#default_value' => $config['input_value'],This will throw an undefined error as you have not given the element a default value, if is not set.
Line 130, 131
This makes no sense, i am sure why it's working though :P Refer to: https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
Line 155
$message = $token_service->replace($form_state->getValue('input_value'), array('user' => $user));$user is undefined.
You may these lines to only execute only when module token exists.
Line 190
You can work to extend this functionality later.
File: openweather.routing.yml
_permission: 'administer module openweather'You may want add a permissions.yml file :) Refer to: #2311427: hook_permission() replaced with permissions defined in a $module.permissions.yml file
File: openweather.libraries.yml
It will look good if you can introduce some spacing b/w two declaration :)
Comment #11
prashant114606 commentedHi @navneet0693 Thanks for giving your time to review this module. I have made changes as per your suggestion and daily forecast functionality is also implemented. putting it in needs review state.
Comment #12
harika gujjula commentedHi prashant114606,
Wheather block shown successfully based on the city but am not able to see proper timings as per the city given. Is there anything am missing?
one suggestion:
It would be good if we have the hook_help
otherwise its good
Comment #13
prashant114606 commentedHi harika gujjula,
Thanks for your feedback
I have fixed the issue related to the time for different timezone. Now you can able to see the right time for the particular city in their timezone.
For the 2nd point I have added the hook_help.
Comment #14
purushotam.rai commentedHi @prashant114606,
Automated Review
Recommendation: 'token' service should be injected.
Manual Review
This review uses the Project Application Review Template.
Comment #15
purushotam.rai commentedAlso @prashant114606, kindly get Review Bonus to speed up your own project through the review process and you will learn a lot.
https://www.drupal.org/node/1975228
Best,
PK
Comment #16
prashant114606 commentedHi @purushotam.rai,
Thanks for your feedback. I have injected token service.
Comment #17
navneet0693 commentedThis is clear to go from my end :) Issuing RTBC
Comment #18
kajalkiran commentedComment #19
prashant114606 commentedComment #20
prashant114606 commentedComment #21
klausiproject page is empty: https://www.drupal.org/sandbox/prashant114606/2839644
Can you describe what your module does, how it works etc.? See also https://www.drupal.org/node/997024
Comment #22
prashant114606 commentedHi @klausi,
Thanks for your feedback. I have updated the project page.
Comment #23
prashant114606 commentedComment #24
prashant114606 commentedComment #25
prashant114606 commentedComment #26
prashant114606 commentedComment #27
klausimanual review:
But that are not application blockers, otherwise looks good to me.
Thanks for your contribution, Prashant!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #28
prashant114606 commentedThank you so much @klausi. Will make the changes as per your suggestions.