Page 1 of 1

Plugin API

Posted: Sun Sep 03, 2017 12:41 am
by Dog2puppy
Something I would like to see with Meteotemplate is a extensive plugin API. API should be Object-Oriented, and should allow for lots of customization.

Re: Plugin API

Posted: Sun Sep 03, 2017 11:03 am
by Jachym
HI,
sorry, no clue what you mean by Plugin API. What should such plugin do? The API already supports all the sensors I could think of and you can send to it any data you want and set it in the extra sensors section.

OOP is something I dont use, for the purposes of MT and the way it is used it is not optimal.

Re: Plugin API

Posted: Sun Sep 03, 2017 12:22 pm
by Dog2puppy
Jachym wrote: Sun Sep 03, 2017 11:03 am HI,
sorry, no clue what you mean by Plugin API. What should such plugin do? The API already supports all the sensors I could think of and you can send to it any data you want and set it in the extra sensors section.

OOP is something I dont use, for the purposes of MT and the way it is used it is not optimal.
By plugin API, I just mean a way to ingrate into Meteotemplate. For example, to get the wind speed I might do this.

Code: Select all

<?php
class MyPlugin extends Plugin {
  $windspeed = $meteotemplate->getCurrentConditions()->getWindSpeed(); //Get wind speed
  echo $windspeed; //Result

Re: Plugin API

Posted: Sun Sep 03, 2017 12:29 pm
by Jachym
Right I see,
the entire template is done in a procedural style, not objective.

What you want can easily be achieved using the stationFeed plugin, which gives you the data in both JSON and XML format

Re: Plugin API

Posted: Sat Sep 09, 2017 5:19 pm
by Dog2puppy
The thing is, I would like to see a expandable system. The way it is now is fine, but in a future update a plugin API would be nice.

Re: Plugin API

Posted: Sat Sep 09, 2017 5:20 pm
by Jachym
Hi,
as I explained what you are suggesting cannot work, simply because there is nothing to "extend", no part of the template (with the exception of one plugin, which was more like an experiment) is using OOP, so you cant just build it from scratch.

I still think the dataFeed plugin does what you need

Re: Plugin API

Posted: Sat Sep 09, 2017 5:35 pm
by Dog2puppy
Jachym wrote: Sat Sep 09, 2017 5:20 pm Hi,
as I explained what you are suggesting cannot work, simply because there is nothing to "extend", no part of the template (with the exception of one plugin, which was more like an experiment) is using OOP, so you cant just build it from scratch.

I still think the dataFeed plugin does what you need
Yes, the datafeed plugin would work, just that in a future update a full api would be nice. There's already the API for updating the data.

Re: Plugin API

Posted: Sat Sep 09, 2017 5:56 pm
by Jachym
But how do you want to make an API when the whole thing is programmed completely differently to what you are proposing