LibreOffice GetRest Plugin

2 0

LibreOffice Calc Add-Inn extension. Extension adds 2 new function to LibreOffice Calc. Function GET(URL) offer u to get data from the internet by simple get request. Example: get("api.openweathermap.org/data/2.5/weather?q=London,uk") Function PARSEJSON(JSON,PATTERN) returns substructure of JSON structure getting according to pattern. Example:d In cell A1 we have value from previous example and in cell A2 parsejson(A1,"weather.get(1).main") the value of A2 will be Rain.

Project Description

LibreOfficeGetRest plugin is Calc Add-Ins Extension which adds two functions to LibreOffice calc.
## Added functions ### 1) Get Get function allow user to perform get request to remote server end get data from it.
Syntax: =get(URL) Where URL is URL which to send a GET request.
Value of cell will be result of get request.
Example:
Cell content:
=get("http://api.openweathermap.org/data/2.5/weather?q=London,uk")
Cell value:
```javascript { "coord":{ "lon":-0.13, "lat":51.51 }, "sys":{ "type":1, "id":5091, "message":0.1999, "country":"GB", "sunrise":1413008314, "sunset":1413047741 }, "weather":[ { "id":801, "main":"Clouds", "description":"few clouds", "icon":"02d" } ], "base":"cmc stations", "main":{ "temp":287.3, "pressure":1011, "humidity":62, "temp_min":285.15, "temp_max":289.15 }, "wind":{ "speed":5.1, "deg":230 }, "clouds":{ "all":20 }, "dt":1413046702, "id":2643743, "name":"London", "cod":200 } ``` ### 2) Parse JSON Parse JSON function allow u to get JSON substructure or direct value from JSON structure. Syntax: =PARSEJSON(JSON,Pattern) Where JSON is valid JSON structure. Pattern is a set of commands to parser splited by dote symbol '.' command.command.command. There two different commands get(XXX) which return the XXX element of JSON array structure, and objectName command which get the value of json object by its name.
Value of cell will be result of parsing if JSON valid and pattern correct or error message otherwise
Example:
Cell content:
A1=
```javascript { "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25, "height_cm": 167.6, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100" }, "phoneNumbers": [ { "type": "home", "number": "212 555-1234" }, { "type": "office", "number": "646 555-4567" } ], "children": [], "spouse": null } ``` A2: =parsejson(A1,"phoneNumbers.get(1).number")
Cell value:
646 555-4567

Category/Categories

Calc Extension

Current Release

No stable release available yet.

All Releases

Version

Released

Platform(s)

Compatibility

Description

License(s)

Status

Legal Disclaimer and Limitations for Downloads

The Document Foundation has not reviewed, and cannot review, all of the material, including computer software, available on or by means of The Document Foundation's
websites, and cannot therefore be responsible for that material's content, use or effects. By operating its websites, The Document Foundation does not represent or imply that it endorses the material there available, or that it believes such material to be accurate, useful or nonharmful. You are responsible for taking precautions as necessary to protect yourself and your computer systems from viruses, worms, Trojan horses and other harmful or destructive content. The Document Foundation's websites may contain content that is offensive, indecent or otherwise objectionable, as well as content containing technical inaccuracies, typographical mistakes and other errors. The Document Foundation's websites may also contain material that violates the privacy or publicity rights, or infringes the proprietary rights, of third parties, or the downloading, copying or use of which is subject to additional terms and conditions, stated or unstated. The Document Foundation disclaims any responsibility for any harm resulting from the use by The Document Foundation's visitors of The Document Foundation's websites, or from any downloading by those visitors of content available on or by means of The Document Foundation's websites.

Changes

Content contained on The Document Foundation's websites, including these Legal Disclaimers and Limitations, may be changed at the sole discretion of The Document Foundation and without notice. You are bound by any such updates or changes, and so should periodically review these Legal Disclaimers and Limitations.

If you believe any file is present on the site contrary to any TDF rule or applicable law, please supply full details to info@documentfoundation.org for impartial consideration.