Sunday, February 26, 2012

Weather Geocoder with Google Maps and Google Weather API

Google Weather GeocoderI got tired of searching locations on weather reporting websites to get instant updates, so I thought of building an instant weather reporting application which would give me information for any location I click on the map. Google Maps API provides an inbuilt reverse-geocoding service which can geocode an IP Address to a place on the map. To get weather information, I’ve used the so called secret Weather API from Google which they use on the iGoogle page widget. Google has not officially published this API but we would love if they do so. The good thing about Google’s weather API is that it is easy to use and includes the weather icons, but there is no way as of now to get the data in other formats apart from XML:
http://www.google.com/ig/api?weather=Chicago.

Demo on my Labs page: http://lab.abhinayrathore.com/geocode_weather/

You can play around with the app on my labs page and view the source on the page to get the JavaScript code to build this tool on your own website. To convert the XML data from Google Weather API to JSONP, I’ve written a small PHP script you can download from the link below.

Click here to get the PHP Script for converting Google Weather API’s XML data to JSON/JSONP format.

You can style the Weather Information window according to your needs or you can use the one I’ve created: http://lab.abhinayrathore.com/geocode_weather/weather.css. You can freely modify the JavaScript code to suit your needs. If you find any bugs or see improvement opportunities, please do drop a comment below and I’ll look into it asap :)

75 comments:

  1. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write ups thanks once again.
    html5 video player

    ReplyDelete
    Replies
    1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai

      Delete
  2. hi, nicely done there great job! and thanks for sharing
    but i have a question...
    is there a way to overcome the PHP Script for converting Google Weather API’s XML data to JSON/JSONP format and converting the original xml file google creates at "http://www.google.com/ig/api?weather=Chicago" to plain html using jquery?

    ReplyDelete
  3. Anonymous,
    Instead of converting the XML to JSONP (I designed it for cross-domain access), you can write a simple proxy script in any language to fetch the Google XML from your JavaScript code. Then you can parse the XML file in jQuery (http://api.jquery.com/jQuery.parseXML/) and get the weather data in formatWeatherData() method.

    ReplyDelete
  4. i've tried that exactly,but i get (in google chrome's inspect element) this error...
    "XMLHttpRequest cannot load file:///C:/Users/andry/Desktop/2.xml. Origin null is not allowed by Access-Control-Allow-Origin."

    and i cant rly think what i did wrong there, thank you again in advance

    ReplyDelete
  5. If you have the XML file locally, then try placing it in the same folder as your script and simply use "2.xml" (without any path) in the ajax call. The best option is to use a proxy script to get the xml data.

    ReplyDelete
  6. Hi,
    The weather google api cannot be used. They treat thee request to get the xml file as an automated query, and just outputs this message:
    We’re sorry… … but your computer or network may be sending automated queries. To protect our users, we can’t process your request right now.

    ReplyDelete
  7. i am getting this error when using your demo page. I am using firefox 13.0.1

    'Error occured during fetching weather data."

    Glenn

    ReplyDelete
  8. Hi. I converted your app to a python/google app engine application. I used weather underground api and it is working fine.

    ReplyDelete
  9. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us. Do check Six Sigma Training in Bangalore | Six Sigma Training in Dubai & Get trained by an expert who will enrich you with the latest trends.

    ReplyDelete
  10. Guaranteed #1 Search Engine Ranking Supreme Free Viral Traffic Join Now Get Millions Of Hits Free To Your Site/Blog!

    PornKings Adult Shopping Backlinks-Shopping Mega Store Legendary Stars As Stormy Daniels,Shawna Edwards,Jenna Jamison-New Adult Stars Movies,Adult Toys,Enhancers,Merchandise-More !

    Hits Express Rotator System Do You Need Visitors to Your Website or Affiliate Program? If your looking to gain more visitors to your website Hits Express is your answer. With our program your site is being shown to people all over the world 24/7 365 days a year!

    PAYDIR Free For All Forum Portal Search Engine Crawled Network PR10 Ranking Information Forum XXX!

    FreeLinkExchanges Be Seen In 12 Nations 312 Sites Over 30 Millions Viewers Monthly Buy Featured Link Now With 150 Search Engines Crawling The Network!

    How do I get guaranteed traffic? When someone signs up from your site, they must first click on your classified ad which will open a new window leading to your main website. They will have to wait a few seconds for the code to appear on a separate frame at the top of the screen reach millions free now!

    Blast Your Ad to Over 23,000 Opt-in Prospects at ShowMyLinks Submit Your Solo Email Ad to All Showmylinks Members GET YOUR TEXT LINK ADs LISTED 100% FREE FOR LIFE PLUS EARN MONEY TO YOUR PAYPAL!!

    Adult Store Empires Backlinks Resources Search Engine XXX!

    GET YOUR OWN MONEY-MAKING AD BOARD -- Integrating Text ad, Banner Ad and Email Ad into one Portal Make Money Fast With Your Paypal Reach Million Dollars In A Year Fast !

    Full Length Homemade Videos Watch real people's private home sex videos. Forget about those shitty 1-2 minute clips, these are all high quality full length videos! 40+ Bonus Sites You will also get full access to the entire reelpass network of sites which features over 40+ awesome movie sites, 1000's of movies and pictures to download! Download, Burn & Share Not only do you get to watch all our movies, you can also download every single one and save it forever, burn them to dvd or share with friends!!

    ReplyDelete
  11. QuickBooks Payroll Support – When it comes to managing accurate financial records, then, QuickBooks name is on the top. QuickBooks has garnered a wide appreciation from the business field. QB name shines in the business world with QuickBooks Payroll feature.

    ReplyDelete
  12. Hello, I'm Smith Warner. If you are facing issues with mcafee(mcafee.com/activate), norton(norton.com/setup) and office(office.com/setup) product. then you can visit my website.

    ReplyDelete

  13. Thanks for sharing such important information your contant is very impressive. I like your explanation of topic and ability to do work.I really found your post very interesting .
    Brighthouse Spectrum | Brighthouse annuities | Brighthouse pay my bill | Brighthouse financial metlife | Bright House email login | Brighthouse Webmail | Brighthouse Email | Spectrum brighthouse login

    ReplyDelete
  14. Your opinion are very interesting, attractive article, so i shared it on my facebook. Promise that a lot of people will enjoy it. QuickBooks Error tech Support

    ReplyDelete
  15. Very nice!!! This is really good blog information thanks for sharing. We are a reliable third party QuickBooks help company offering technical support for various any types of technical errors.

    ReplyDelete
  16. There can be various problems you can encounter while using your printer and the Epson Printer Offline issue is one of them. You can visit the page and get immediate answers.

    ReplyDelete
  17. Gati Packers and Movers _ top and best packers and movers at very good rates and hassale free transportation service provider in all over india and other countries also Gati Packers and Movers

    ReplyDelete
  18. Canon has been known for manufacturing printers and its services are enjoyed by a number of people. To get latest & updated drivers for canon printer all models, visit canon.com/ijsetup and download driver free.

    ReplyDelete
  19. Thanks for sharing such an informative post.
    However, at times they face few errors with, QuickBooks Online login problems on Chrome when signing in on the Intuit official website.

    QuickBooks File Doctor | QuickBooks Install Diagnostic Tool

    ReplyDelete
  20. Thanks for sharing such an informative post.
    We hope you find this article helpful in solving the issues that QuickBooks Error Code 15270. Also, if you are facing issues even after performing the solutions provided here, you can call our Resolve Pdf and Printing Errors with QuickBooks Desktop Team at +1(800)-880-6389 and speak to certified experts.

    ReplyDelete
  21. Internet crimes are increasing rapidly, users have to protect their system, important files, and data from different kinds of viruses and malware. you can activate and protect your computer system with the help of www.mcafee.com/activate website.

    ReplyDelete

  22. You're a talented blogger. I have joined your bolster and foresee searching for a more noteworthy measure of your amazing post. Also, I have shared your site in my casual networks!


    mcafee.com/Activate
    mcafee.com/Activate
    Office.com/setup
    Office.com/setup

    ReplyDelete
  23. You're a gifted blogger. I have joined your feed and anticipate looking for a greater amount of your awesome post. Additionally, I have shared your site in my informal communities!
    mcafee.com/activate
    norton.com/setup
    norton.com/setup
    office.com/setup
    norton.com/setup
    norton.com/setup

    ReplyDelete
  24. Norton 360 Premium for up to 10 gadgets gives you ground-breaking layers of security for your associated gadgets and online protection. norton.com/setup Your own gadgets and data have assurance as you bank, shop, and post on the web, both at home and on open Wi-Fi.

    ReplyDelete
  25. Excellent blog! This post is very useful for Comcast email users. This blog provides the solutions for comcast email settings issues. It is very important blog for users. Thanks for sharing this valuable blog.

    ReplyDelete
  26. I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.

    norton.com/setup

    Charter.net

    www.norton.com/setup

    roadrunner email login

    ReplyDelete
  27. Thanks to author of post for such a great information.I like your blog post and subscribe your blog for all your future post.i have also some links which i think is useful for some users. I have something to share here.
    McAfee.com/activate,
    www.mcafee.com/activate,
    www.mcafee.com/activate total protection,
    www.mcafee.com/activate product key

    ReplyDelete
  28. Presently, technology is changing at a snappier pace than at any other time. With all the development in innovation comes the expanding number of opportunities for cybercriminals to mishandle. As an outcome, cybersecurity has become incredibly fundamental so as to protect persona, shoppers, and business data against different dangers. On the off chance that you don't have the suitable wellbeing systems set up, at that point you are at a danger of digital assaults. McAfee antivirus bans all the infections and malware from entering and contaminating the framework.

    mcafee activate |
    mcafee activate |

    ReplyDelete
  29. Presently, technology is changing at a snappier pace than at any other time. With all the development in innovation comes the expanding number of opportunities for cybercriminals to mishandle. As an outcome, cybersecurity has become incredibly fundamental so as to protect persona, shoppers, and business data against different dangers. On the off chance that you don't have the suitable wellbeing systems set up, at that point you are at a danger of digital assaults. McAfee antivirus bans all the infections and malware from entering and contaminating the framework.

    mcafee activate |
    mcafee activate |

    ReplyDelete
  30. AntiVirus-Norton is the passage level antivirus arrangement offered by the organization. It gives different layers of continuous security against all types of noxious programming, for example, infections, spyware, Trojans and others.
    norton.com/setup |
    norton download |
    norton account

    ReplyDelete

  31. i am a it softwere analyst,i have a project(website) to promote on google search engin.here is something about my project. iamcafee is a free specialized help specialist organization for McAfee items. We are a free help authority association for programming related issues in compact PCs, work areas, contraptions and peripherals. Use Of McAfee Name, logo, trademarks and its pictures is only for reference and not the smallest piece recommend that mcafee.com has any business association with McAfee. McAfee trademarks, names, logo and pictures are the property of their different owners. We holds no connection or relationship with any of these brands or untouchable associations and solely offer assistance advantage for the thing issues went up against by customers. If your item is under guarantee, you may get free help administration from the brand owners.
    mcafee.com/activate |
    mcafee activate |



    ReplyDelete
  32. This is very informative post, good work, i like this content and wish to read more from you. thanks for such a informative post. i also like to share some useful links.
    mcafee.com/activate,
    www.mcafee.com/activate

    ReplyDelete
  33. Thank you for sharing this wonderful article, And it is very useful information norton.com/setup
    www.norton.com/setup

    ReplyDelete
  34. Thank you so much for this Post and all the best for your future. You are really a talented person I have ever seen. I am satisfied with the arrangement of your post i think i must share here
    www.mcafee.com/activate
    mcafee.com/activate

    ReplyDelete
  35. Very nice article, I found it very useful .Even I have this wonderful website, Good quality of windows and doors are very essential for any workplace www.avg.com/retail

    avg.com/retail

    ReplyDelete
  36. Dear Admin, you have shared very informative information with us through your article. this information is very useful for me and you are doing amazing work keep it up. I want also to share something with you. Thank you so much for sharing this and I wish you all the best for the upcoming article. norton.com/setup
    www.norton.com/setup, Norton product key

    ReplyDelete
  37. Great post i must say and thanks for the information.I appreciate your post and look forward to more.

    McAfee login Mobile Security protects your mobile devices and personal data from cyberthreats, unsecured networks and malicious apps.

    https://mcafeepro.com/

    ReplyDelete
  38. I really happy found this website eventually. Really informative and inoperative, Thanks for the post and effort! Please keep sharing more such blog.

    bitcoin login

    bitcoin signin

    aolmail.com

    mcafee.com/activate

    norton.com/setup

    roadrunner email login

    ReplyDelete
  39. Mcafee Login My Account : I have read your article which is quite good to go through with this. Your blog is excellent. You can also visit Mcafee Login My Account https://mcafeepro.com to protect your devices. Mcafeepro antivirus I personally used for 7 years its popular virus protection software which secures my system from the online threats.

    ReplyDelete
  40. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    blockchain online training
    best blockchain online training
    top blockchain online training

    ReplyDelete
  41. Wow, What an incredible blog you have shared with us, The content quality and the way you have describe it is amazing all information is very useful for me. Thank you so much for such an amazing blog and wish you the best of luck for the next comment and I also want to share some useful links here. www.office.com/setup, Office product key, office.com/setup

    ReplyDelete
  42. Avail elite web-security on your computer with Webroot. Rapidly download, introduce, and enact the item by visiting webroot.com/safe

    ReplyDelete
  43. very nice blogs!!! i have to learning for lot of information for this sites.Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing

    Acquired and Inherited Traits
    fiu canvas
    Alphanumeric Characters
    Area of a Rhombus

    ReplyDelete
  44. I am very happy to read your article whenever I read it I found something new and interested information in your blog. Thank you so much for share this informative information with us and all the best for the next comment. mcafee.com/activate, www.mcafee.com/activate, mcafee activation code

    ReplyDelete
  45. Thank you for Sharing this information.
    An error that users receive while updating QuickBooks Desktop or Payroll i.e., QuickBooks Payroll Support Number. It’s a common QuickBooks update error that may leave you wondering what went wrong.

    how to update quickbooks | quickbooks windows 10 compatible

    ReplyDelete
  46. This is an informative post. Thank You for sharing this.
    This error might result in losing the unsaved data. The user can only click on the On tab on hovering over the QuickBooks Multi-User Mode Not Working Problem message.

    QuickBooks Abort Error | QuickBooks Unrecoverable Error

    ReplyDelete
  47. According to a new report by Expert Market Research, ‘Biofuel Enzymes Market Size, Share, Price, Trends, Growth, Report and Forecast 2021-2026’, the Biofuel Enzymes Market size was valued at USD XX million in 2020 and is predicted to register a CAGR of XX% from 2021 to 2026.

    Download a free Sample Report : Biofuel Enzymes Market Size, Report & Forecast

    ReplyDelete

  48. Stumbled on Quickbooks multi-user mode not working error?

    Well, Quickbooks multi-user mode not working error would have occurred due to:
    QuickbooksDBXX services have not started yet.
    .TLG file is corrupted.

    What can be done to fix Quickbooks multi-user mode not working error?
    Check if the Quickbooks services are running.
    To see this, go to service.msc from the windows search bar and check if QuickbooksDBXX service is there in the windows list.

    To conclude!!
    “Quickbooks multi-user mode not working error” is now averted!! If you are still facing any issues in fixing Quickbooks multi-user mode not working error, you can reach out to QBSsolved at 1-888-910-1619.

    ReplyDelete
  49. Quickbooks deals with the financial accounting works in your businesses. But it may encounter several errors like Quickbooks unable to verify financial institution errors.

    Causes of Quickbooks unable to verify financial institution error:
    Quickbooks may be older than three years.
    Bank or credit card may not be recognized by Quickbooks.
    .QBO file was not created properly.
    .QBO file must have been built by the third party services.

    ReplyDelete
  50. Do you enjoy reading stories? Read our entertaining short stories specially written for intermediate or upper intermediate level learners.Stories include the following: bedtime stories ,
    english stories , moral stories,
    motivational stories ,krishna stories and many more .you can read with your child and what they'll learn from them.
    you can check our amazon quiz ,general knowledge quiz

    ReplyDelete
  51. According to a new report by Expert Market Research, ‘Heat Exchanger Market Size, Share, Price, Trends, Growth, Report and Forecast 2021-2026’, the Heat Exchanger Market size was valued at USD XX million in 2020 and is predicted to register a CAGR of XX% from 2021 to 2026.

    Download a free Sample Report : Heat Exchanger Market Size, Report & Forecast

    ReplyDelete
  52. I like to say you are good writing skills, the way you explain things is extraordinary, I have subscribed to your blog for future posts. you must follow the below links for useful information.

    สูตรเสือมังกร
    สูตร เสือ มังกร
    เสือ มังกร ออนไลน์

    ReplyDelete

Thanks a lot for your valuable comments :)