Skip to content

Instantly share code, notes, and snippets.

View Luidog's full-sized avatar

Lui de la Parra Luidog

View GitHub Profile
@Luidog
Luidog / book.json
Created February 2, 2018 17:40
Example JSON
{
"kind": "books#volumes",
"totalItems": 1,
"items": [
{
"kind": "books#volume",
"id": "pbR9tgAACAAJ",
"etag": "MiROYnWU3Cs",
"selfLink": "https://www.googleapis.com/books/v1/volumes/pbR9tgAACAAJ",
"volumeInfo": {
@Luidog
Luidog / getBookName.txt
Last active February 14, 2018 04:56
JSONGetElement Example
JSONGetElement ( $json ; "name" )
// → "The Signal and the Noise"
@Luidog
Luidog / generator-statuscode-patch.xml
Created February 12, 2018 19:33
HTTP Native ({request}) Status Code Patch
<?xml version="1.0" encoding="UTF-8"?>
<fmxmlsnippet type="FMObjectList">
<Step enable="True" id="89" name="# (comment)">
<Text>PATCH Proposed By L.D. and E.M.</Text>
</Step>
<Step enable="True" id="89" name="# (comment)">
<Text>--------------------------------------------------------------------------------------------</Text>
</Step>
<Step enable="True" id="89" name="# (comment)"/>
<Step enable="True" id="89" name="# (comment)">
@Luidog
Luidog / getBookJSON.txt
Last active February 14, 2018 04:56
JSonGetElement
Set Variable [ $json ; Value: JSONGetElement ( $response ; "items[0]" ) ]
// → $json
JSONGetElement ( $json ; "volumeInfo.authors[0]")
// → "Nate Silver"
Set Field [ Books::title ; JSONGetElement ( $response ; "items[0]" ) ]
Set Field [ Books::authors ; JSONGetElement ( $json ; "volumeInfo.authors[0]" ) ]
Insert from URL [Select; No dialog; $json ; "https://www.googleapis.com/books/v1/volumes?q=isbn:"& Books::ISBN ]
Set Field [ Books::title ; JSONGetElement ( $volumeInfo ; "title" ) ]
Set Field [ Books::authors ; JSONGetElement ( $volumeInfo ; "authors" ) ]
Set Field [ Books::publishedDate ; JSONGetElement ( $volumeInfo ; "publishedData" ) ]
Set Field [ Books::publisher ; JSONGetElement ( $volumeInfo ; "publisher" ) ]
Set Field [ Books::language ; JSONGetElement ( $volumeInfo ; "language" ) ]
Set Field [ Books::description ; JSONGetElement ( $volumeInfo ; "description" ) ]
https:// {{host}} / {{route}} / {{endpoint}} ? {{parameter}} = {{value}}
https://www.googleapis.com/books/v1/volumes?q=isbn:"& Books::ISBN