Recent

Author Topic: fpowm library - OpenWeatherMap (OWM)  (Read 3313 times)

CieloInvernale

  • Newbie
  • Posts: 5
fpowm library - OpenWeatherMap (OWM)
« on: December 03, 2016, 12:04:34 pm »
There's a Free Pascal - Open Weather Map library avaiable at https://github.com/SAmeis/fpowm, that gives users the possibility to interface with Open Weater API http://openweathermap.org/, unfortunately I was not able to install it: Lazarus tries to rebuild itself but ends with a "panic message". Is it just my Lazarus' installation that's somehow corrupted or is there something wrong in the library's package??

Looks like there's a missing file in the package: "inc\instarray.inc".

Has anyone else experienced troubles with this package??

I'm using Lazarus 1.6, FPC 3.0.0, Win 64 (Windows 10).

Thanks for your time and answers.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: fpowm library - OpenWeatherMap (OWM)
« Reply #1 on: December 03, 2016, 06:38:56 pm »
Looks like there's a missing file in the package: "inc\instarray.inc".

Yes, and looks like other things are missing as well: a license, documentation, etc.

I would suggest just signing up for the free-tier OpenWeatherMap API key and calling the API directly. Looks quite straightforward: Call the API, passing params in the URL's query string (after "?"). It passes back JSON data, which you parse.

http://openweathermap.org/current

Looks like you could plug that resulting weather data into a map such as this:

https://macpgmr.github.io/MacXPlatform/WebAppOverview_2.html


CieloInvernale

  • Newbie
  • Posts: 5
Re: fpowm library - OpenWeatherMap (OWM)
« Reply #2 on: December 04, 2016, 06:50:42 pm »
The developer of this library has resolved the bug and closed the issue:

https://github.com/SAmeis/fpowm/issues/1

six1

  • Full Member
  • ***
  • Posts: 117
Re: fpowm library - OpenWeatherMap (OWM)
« Reply #3 on: December 05, 2016, 01:16:26 pm »
Hi,
new version did also not compile for me.

I did two steps, to get it work:
1)
remove
windres.exe -J rc -O res "component_img.rc" "component_img.res"
in compiler options.

2)
in file owmdata.pas row 883 (DefaultOptions is unknown, but per default second var is "true", so just uncomented))
  p := TJSONParser.Create(aStr);//, DefaultOptions);


now it works for me.

 

TinyPortal © 2005-2018