Dog Weather module for Drupal 6.
git clone --branch 6.x-1.x jason.lopez@git.drupal.org:sandbox/jason.lopez/1412278.git dog_weather
git clone --branch master jason.lopez@git.drupal.org:sandbox/jason.lopez/1412278.git dog_weather
The Dog Weather module is a custom module that was developed for the dogzville.com website, a social network for the dog-friendly community. It includes the ability to collect observed and forecast weather information from the noaa.gov website. For performance reasons, it was decided that observed weather from each ICAO would be downloaded, unzipped and made available only once at the top of each hour. This would eliminate the need to develop a real-time SOAP/XML request / caching facility when a user entered a zip code or city, state. The ability to associate location information with the nearest ICAO is based on a mySQL table that includes a relationship between the lat and long coordinates of each zipcode and its closest ICAO. A three day weather forecast is made available to site visitors using a real-time SOAP/XML request / caching facility. The majority of functions are utility functions that are meant to either collect the data, perform various operations on it and load it into a table once an hour or make real-time requests and cache it for future requests.
I looked at various modules including the weather.module to determine if I could use it to satisfy dogzville.com weather requirements but I found that there would be to much manipulation and overriding involved to make it work. The approach to identify the closest ICAO for a given visitor location and lack of forecast weather information for a given location were also considerations when determining the viability of an existing module.
Review of other projects:
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | drupalcs-result.txt | 2.1 KB | klausi |
| #11 | drupalcs-result.txt | 5.67 KB | klausi |
| #4 | Review.txt | 48.47 KB | darrell_ulm |
Comments
Comment #1
asifnoor commentedManual review
1. Use 6.x-1.x branch instead of master for development. Check Release naming conventions
2. use a package name in your .info file to keep separation of your module with others
3. use check_plain function while retrieve and storing data from xml
4. its best you use an template file if there is lot of html and styling required instead of writing everything in the theme function.
5. in some of your sql queries you have used %d for the placeholder zipcode in single quotes and some places you did not. Please maintain consistency.
Comment #2
jlopez commentedThe changes that you outlined have been completed and the updated code has been pushed to the 6.x-1.x branch.
Comment #3
jlopez commentedbump
Comment #4
darrell_ulm commentedThere were many coding standard issues with this code.
Please see the attached file.
Also read these and follow the coding standards.
http://drupal.org/coding-standards
http://drupal.org/node/1354
Comment #5
jlopez commentedCorrected all issues identified in the attached Review.txt file and ran a clean pareview.
Comment #6
bart.hanssens commentedHi,
nice module, a few suggestions though
Comment #7
bart.hanssens commentedIn addition:
Comment #8
jlopez commentedThank you for the feedback and taking the time to review my code.
I moved the ICAO location data from the .install file to a separate .csv file. I attempted to use drupal_write_record() to insert records into the database table but ran into issues. After debugging and performing some research, I found that I could not get away with using drupal_write_record() in the *.install file because certain data structures required by the function are not available at the time that hook_install() is triggered. I reverted back to an INSERT but .install looks much cleaner.
The round() function is precise enough but it doesn't do truncation. So I used floor and ceil to truncate but they don't have a precision capability so I had to adjust for precision.
I made the modifications to tpl.php files to use t() around all labels.
Right now the module is designed for the US only. I determine the closest ICAO to your location based on city, state or zip code. I currently don't include the same capability outside the US, so I stripped out ICAO's from the locations table for non-US stations.
Finally, I created an admin page as you suggested and now include the ability to more easily change URL's.
Thanks again!
Comment #9
jlopez commentedComment #10
patrickd commentedSorry for the delay! :(
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
Comment #11
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
Review of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
manual review:
Comment #12
jlopez commentedThank you for the review.
I made the necessary changes that you outlined under manual review except for removing the data stored under the two different units of measure. I receive all information provided through both noaa.gov interfaces and store them with future plans (next release) to make use of them.
I am not sure why Coder and Drupal Code Sniffer identified additional issues as I have been using the two applications to verify my code and they have both come back clean. I am also not sure why two files were listed in the attached results as the issues that were identified had already be taken care of some months ago and committed. I did verify that they were in fact made some months ago and recommitted to cover my bases.
I will be working towards doing my own reviews of other projects shortly (just have to get up to speed on the process).
Comment #12.0
jlopez commentedchanged git statement to point to 6.x-1.x branch.
Comment #12.1
jlopez commentedWorking on review bonus.
Comment #13
avpadernoComment #14
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Comment #15
jlopez commentedThank you for the review.
I have made all of the changes that you outlined.
I will work on completing the review bonus right away.
Comment #16
webdorado commentedThe field icao in the table dog_weather_icao is assigned as Autoincrement primary key. You should not give a value to that field in the insert queries. MySQL will give the value automatically.
Comment #17
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #17.0
klausiWorking on review bonus.