Overview

Namespaces

  • EventPost
  • None

Classes

  • EventPost
  • EventPost_Cal
  • EventPost_List
  • EventPost_Map
  • EventPost_Search
  • EventPostWeather

Functions

  • event_post_format_color
  • event_post_get_all_terms
  • eventdetails_block_init
  • EventPost
  • eventpost_list_block_init
  • eventpost_timeline_block_init
  • eventscalendar_block_init
  • eventsmap_block_init
  • get_the_date_end
  • get_the_date_start
  • get_the_dates
  • get_the_location
  • the_date_end
  • the_date_start
  • the_dates
  • the_location
  • Overview
  • Namespace
  • Class

Class EventPostWeather

Provides weather support thanks to OpenWeatherMap http://openweathermap.org

License: Creative Commons (cc-by-sa) http://creativecommons.org/licenses/by-sa/2.0/.

Get an API key http://openweathermap.org/appid#get

Package: event-post
Located at inc/openweathermap.php
Methods summary
public
# __construct( )
public
# EventPostWeather( )

PHP4 constructor

PHP4 constructor

public
# localize( )

Only for localization

Only for localization

Available values:

  • clear sky
  • few clouds
  • scattered clouds
  • broken clouds
  • shower rain
  • rain
  • thunderstorm
  • snow
  • mist
public
# get_settings( array & $ep_settings, boolean & $reg_settings )

Get settings

Get settings

Parameters

$ep_settings
&$ep_settings
$reg_settings
&$reg_settings
public
# settings_form( type $ep_settings )

Settings form

Settings form

Parameters

$ep_settings
public
# init( object $EP )

Initialization of weather support

Initialization of weather support

Parameters

$EP
public array
# params( array $params = array() )

Alters parameters

Alters parameters

Parameters

$params

Returns

array
public WP_Post
# retreive( WP_Post $event )

Alters an event object

Alters an event object

Parameters

$event

Returns

WP_Post
public array
# scheme_entities( array $attr = array() )

Alters schema entities

Alters schema entities

Parameters

$attr

Returns

array
public array
# scheme_values( array $values = array(), $post = null )

Alters schema values

Alters schema values

Parameters

$values
$post

Returns

array
public array
# default_shema( array $schema )

Alters default schema

Alters default schema

Parameters

$schema

Returns

array
public
# get_single( $event_datas, $post = null )
public
# get_weather_icons( $weather )
public string
# get_weather_item( object $item )

Get weather item

Get weather item

Parameters

$item

Returns

string
public string
# get_weather( type $post = null, $echo = false )

Get weather

Get weather

Parameters

$post
$echo

Returns

string
public type
# get_weather_datas( type $event )

Get weather datas

Get weather datas

Parameters

$event

Returns

type
public type
# get_url( type $method = 'weather', type $params = array() )

Generates the URL to call the API

Generates the URL to call the API

Parameters

$method
$params

Returns

type
public object
# get_current( type $event )

Current weather http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&APPID=XXXX

Current weather http://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lon}&APPID=XXXX

Return: {"coord":{"lon":139,"lat":35}, "sys":{"country":"JP","sunrise":1369769524,"sunset":1369821049}, "weather":[{"id":804,"main":"clouds","description":"overcast clouds","icon":"04n"}], "main":{"temp":289.5,"humidity":89,"pressure":1013,"temp_min":287.04,"temp_max":292.04}, "wind":{"speed":7.31,"deg":187.002}, "rain":{"3h":0}, "clouds":{"all":92}, "dt":1369824698, "id":1851632, "name":"Shuzenji", "cod":200}

Parameters

$event

Returns

object
public type
# get_forecast( type $event )

Forecast api.openweathermap.org/data/2.5/forecast?lat={lat}&lon={lon}&APPID=XXXX

Forecast api.openweathermap.org/data/2.5/forecast?lat={lat}&lon={lon}&APPID=XXXX

Return: {"city":{"id":1851632,"name":"Shuzenji", "coord":{"lon":138.933334,"lat":34.966671}, "country":"JP", "cod":"200", "message":0.0045, "cnt":38, "list":[{ "dt":1406106000, "main":{ "temp":298.77, "temp_min":298.77, "temp_max":298.774, "pressure":1005.93, "sea_level":1018.18, "grnd_level":1005.93, "humidity":87 "temp_kf":0.26}, "weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}], "clouds":{"all":88}, "wind":{"speed":5.71,"deg":229.501}, "sys":{"pod":"d"}, "dt_txt":"2014-07-23 09:00:00"} ]}

Parameters

$event

Returns

type
public type
# get_history( type $event )

history

http://api.openweathermap.org/data/2.5/history/city?lat={lat}&lon={lon}&type=hour&start={start}&end={end}&APPID=XXXX

history

http://api.openweathermap.org/data/2.5/history/city?lat={lat}&lon={lon}&type=hour&start={start}&end={end}&APPID=XXXX

Parameters: lat, lon coordinates of the location of your interest type type of the call, keep this parameter in the API call as 'hour' start start date (unix time, UTC time zone), e.g. start=1369728000 end end date (unix time, UTC time zone), e.g. end=1369789200 cnt amount of returned data (one per hour, can be used instead of 'end') * return: {"message":"","cod":"200","type":"tick","station_id":39419,"cnt":30, "list":[ {"dt":1345291920, "main":{"temp":291.55,"humidity":95,"pressure":1009.3}, "wind":{"speed":0,"gust":0.3}, "rain":{"1h":0.6,"today":2.7}, "calc":{"dewpoint":17.6} } ]}

Parameters

$event

Returns

type
Properties summary
public $META_WEATHER
#
public $api_key
#
public $units
#
public $unit_names
#
public $theme
#
API documentation generated by ApiGen