PRO: Show Page-Properties

Challenge: Show and use WordPress-Page-Properties like User-ID, Page-ID etc.


Solution: Create a new JCI-Template with name “showpageproperties” and URL “dummyrequest” (or an URL with JSON) and this twig-Code:

{% set pageprop = wp_get_page_properties() %}
get_current_user_id: {{pageprop.get_current_user_id}}
get_post.ID: {{pageprop.get_post.ID}}
all data:
{{pageprop |json_encode | e}}

Then you can use this Shortcode to display the properties:

[jsoncontentimporterpro nameoftemplate="showpageproperties"]

In Action:

get_current_user_id: 0
get_post.ID: 9540
all data:
{"get_permalink":"http://api.json-content-importer.com/pro-plugin-examples/pro-show-page-properties/","home_url":"http://api.json-content-importer.com","get_current_user_id":0,"userdata":false,"get_post":{"ID":9540,"post_author":"1","post_date":"2022-01-30 20:37:32","post_date_gmt":"2022-01-30 19:37:32","post_content":"<!-- wp:paragraph -->\n<p><strong>Challenge:</strong> Show and use Wordpress-Page-Properties like User-ID, Page-ID etc.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:separator -->\n<hr class=\"wp-block-separator\"/>\n<!-- /wp:separator -->\n\n<!-- wp:paragraph -->\n<p><strong>Solution:</strong> Create a new JCI-Template with name \"showpageproperties\" and URL \"dummyrequest\" (or an URL with JSON) and this twig-Code:</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:enlighter/codeblock -->\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{% set pageprop = wp_get_page_properties() %}\nget_current_user_id: {{pageprop.get_current_user_id}}\nget_post.ID: {{pageprop.get_post.ID}}\nall data:\n{{pageprop |json_encode | e}}</pre>\n<!-- /wp:enlighter/codeblock -->\n\n<!-- wp:paragraph -->\n<p>Then you can use this Shortcode to display the properties:</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:enlighter/codeblock -->\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[[ nameoftemplate=\"showpageproperties\"]]</pre>\n<!-- /wp:enlighter/codeblock -->\n\n<!-- wp:separator -->\n<hr class=\"wp-block-separator\"/>\n<!-- /wp:separator -->\n\n<!-- wp:paragraph -->\n<p><strong>In Action:</strong></p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>[ nameoftemplate=\"showpageproperties\"]</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:separator -->\n<hr class=\"wp-block-separator\"/>\n<!-- /wp:separator -->\n\n<!-- wp:paragraph -->\n<p>Remark: In the field \"post_content\" the string \"\" is removed, as this could be cause trouble in executing there shortcodes again and again</p>\n<!-- /wp:paragraph -->","post_title":"PRO: Show Page-Properties","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"pro-show-page-properties","to_ping":"","pinged":"","post_modified":"2022-02-01 23:06:39","post_modified_gmt":"2022-02-01 22:06:39","post_content_filtered":"","post_parent":9627,"guid":"http://api.json-content-importer.com/?page_id=9540","menu_order":120,"post_type":"page","post_mime_type":"","comment_count":"0","filter":"raw"},"cpf":{"_edit_lock":["1643753200:1"],"_edit_last":["1"],"jci_pagehead":[""],"_jci_pagehead":["field_602bcf9303a35"],"jci_pagetitle":[""],"_jci_pagetitle":["field_602bcf9d03a36"]}}

Remark: In the field “post_content” the string “jsoncontentimporterpro” is removed, as this could be cause trouble in executing there shortcodes again and again

PRO: Set Page-Title and Head-Tags by JSON and CPF

This pages shows you, how to set the Page-Title and Head-Tags out of JSON-data together with Custom Post Fields.

  • Step 1: Add “Custom Post Fields” (CPF) to “Custom Post Type” (CPT)
    You need two Custom Post Fields named “jci_pagetitle” and “jci_pagehead”. One way is to do that with ACF.
    Connect these CPF with the CPT you want to set Title and Head, e. g. “Pages”.
  • Step 2: Custom Post Fields
    Create a new Custom Post Page (CPP) out of the Custom Post Type you connected to the new Custom Post fields (CPF). Add some dummyvalues to the CPF and preview the CPP: The title should be the dummyvalue you set in “jci_pagetitle”
  • Step 3: Create a new JCI-Template
{{ ("now"|date("H:i:s")) }} - name is {{urlparam.ename |e('html') | slice(0, 5)}} - {{ _context.0.name}}
  • Step 4: Add shortcode with template
    Insert the following into the CPF “jci_pagetitle”:
    begin-[jsoncontentimporterpro nameoftemplate=addpagetitle]-end
    The preview of the page should have the HTML-Title <title>begin-name is Love Breakfast-end</title> out of JSON-data. And out of first 5 characters of the GET-parameter “ename”, see here.
  • Step 5: Add Head-Tags to page, created out of JSON (Step 4 and the Shortcode there is required!)
    Insert the following into the CPF “jci_pagehead”:
<meta name="event" content="{{urlparam.ename |e('html'|slice(0, 3) ) }}-{{ local_date|date("s:i;H-m/d/Y") }}: {{_context.0.name}}">#LF#<meta name="city" content="{{_context.0.venue.city}}">

See it in action here (open HTML-Sourcecode for that in the browser, please): JSON and the first 3 characters of the GET-parameter “ename” meet in Meta-Tags.

www.opengov-muenchen.de: locations counting bicyle-traffic

Challenge:
Show locations counting bicyle-traffic in munich
https://www.opengov-muenchen.de/api/action/datastore_search?resource_id=211e882d-fadd-468a-bf8a-0014ae65a393&limit=5

Local stored JSON


twig-template:

<a href="https://www.opengov-muenchen.de/dataset/raddauerzaehlstellen-muenchen/resource/211e882d-fadd-468a-bf8a-0014ae65a393" target="_blank">Raddauerzählstellen in München</a><br>
<ul>{% for r in result.records %}
<li>{{r.zaehlstelle_lang}}</li>
{% endfor %}
</ul>
<p>
Datenquelle: dl-de/by-2-0: Landeshauptstadt München – www.opengov-muenchen.de

In Action:

Raddauerzählstellen in München
  • Arnulfstr. 9 - 11 Südseite
  • Bad-Kreuther-Str.
  • Rudolf-Harbig-Weg (Olympia Park)
  • Birketweg HLP (Hirschgarten)
  • Margaretenstr. (Harras)

Datenquelle: dl-de/by-2-0: Landeshauptstadt München – www.opengov-muenchen.de

PRO: oAuth Example – getToken

This pages shows the oAuth-Token requested from
http://api.json-content-importer.com/extra/api/gettoken.php

The request on this URL must be like this:

  • method: CURL-POST
  • curloptions: Here we define the login user/password to get the token.
CURLOPT_POSTFIELDS={"user":"test", "password":"mypass"}
  • twig-template:
{{ _context.access_token }}

Shortcode (try {{ _context | json_encode }} ): If you get the token remove the “httpstatuscodemustbe200=no” from the shortcode

[jsoncontentimporterpro nameoftemplate="gettoken" httpstatuscodemustbe200=no]

This gives us the token (the token is md5(“mypass”) – in real life this is a not that easy):

a029d0df84eb5549c641e04a9ef389e5

The complete API-response is:

{"access_token":"a029d0df84eb5549c641e04a9ef389e5","token_type":"bearer","expires_in":"3600"} 

In action:

a029d0df84eb5549c641e04a9ef389e5

API: data.fcc.gov

API: https://data.fcc.gov/api/license-view/basicSearch/getLicenses?searchValue=Verizon%20Wireless&format=json

Locally Stored: http://api.json-content-importer.com/extra/json/datafccgovgetLicenses.json

Create a new JCI-Template:

  • URL: see above
  • twig-template:
    {% if l.licName matches “/^Cellco/” %}
    is a regular expression. Effect: only those items are displayed, where “licName” starts with “Cellco”
status: {{status}}<br>
Licenses:<br>
{% for l in Licenses.License %}
    {% if l.licName matches "/^Cellco/" %}
        {{l.licName}}, {{l.licenseID}}<br>
    {% endif %}
{% endfor %}

In Action:

status: OK
Licenses:
Cellco Partnership d/b/a Verizon Wireless, 3000020853
Cellco Partnership d/b/a Verizon Wireless, 3000020851
Cellco Partnership d/b/a Verizon Wireless, 3000074239
Cellco Partnership d/b/a Verizon Wireless, 3000058281
Cellco Partnership d/b/a Verizon Wireless, 3000065642
Cellco Partnership d/b/a Verizon Wireless, 3000072157
Cellco Partnership d/b/a Verizon Wireless, 3000069306
Cellco Partnership d/b/a Verizon Wireless, 3000089270
Cellco Partnership d/b/a Verizon Wireless, 3000084172
Cellco Partnership d/b/a Verizon Wireless, 3000086177
Cellco Partnership d/b/a Verizon Wireless, 3000088060
Cellco Partnership d/b/a Verizon Wireless, 3000086042
Cellco Partnership dba Verizon Wireless, 13328
Cellco Partnership dba Verizon Wireless, 979745
Cellco Partnership dba Verizon Wireless, 993326
Cellco Partnership dba Verizon Wireless, 993327
Cellco Partnership dba Verizon Wireless, 993328
Cellco Partnership dba Verizon Wireless, 993488
Cellco Partnership dba Verizon Wireless, 993586
Cellco Partnership dba Verizon Wireless, 995551
Cellco Partnership dba Verizon Wireless, 1002744
Cellco Partnership dba Verizon Wireless, 1002745
Cellco Partnership dba Verizon Wireless, 1003096
Cellco Partnership dba Verizon Wireless, 1003097
Cellco Partnership dba Verizon Wireless, 1003229
Cellco Partnership dba Verizon Wireless, 1004107
Cellco Partnership dba Verizon Wireless, 1005212
Cellco Partnership dba Verizon Wireless, 1005213
Cellco Partnership dba Verizon Wireless, 1005412
Cellco Partnership dba Verizon Wireless, 1092374
Cellco Partnership dba Verizon Wireless, 1092516
Cellco Partnership dba Verizon Wireless, 2366124
Cellco Partnership dba Verizon Wireless, 2366352
Cellco Partnership dba Verizon Wireless, 2366354
Cellco Partnership dba Verizon Wireless, 2366356
Cellco Partnership dba Verizon Wireless, 2375580

PRO: API https://house.utah.gov

API: https://house.utah.gov/lookup.php?action=reps

Local stored JSON: http://api.json-content-importer.com/extra/json/houseutahgov/1.json

twig-template:

{% for l in legislators %}
id: {{l.id}}<br>
formatName: {{l.formatName}}<br>
email: {{l.email}}<br>
address: {{l.address}}<br>
image: {{l.image}}<br>
profession: {{l.profession}}<br clear=all>
{% for k,v in committees %}
{{v}}
{% endfor %}
<hr>
{% endfor %}

In Action:

id: FERRYJ
formatName: Joel Ferry
email: jferry@le.utah.gov
address: 780 N 1100 W, BRIGHAM CITY, UT, 84302
image: https://le.utah.gov/images/legislator/FERRYJ.jpg
profession: Farmer/Rancher

id: MOSSJ
formatName: Jefferson Moss
email: jeffersonmoss@le.utah.gov
address: 1668 N ASPEN CIR, SARATOGA SPRINGS, UT, 84045
image: https://le.utah.gov/images/legislator/MOSSJ.jpg
profession: Investments

id: POTTEVK
formatName: Val K. Potter
email: valpotter@le.utah.gov
address: 2185 N 1400 E, NORTH LOGAN, UT, 84341
image: https://le.utah.gov/images/legislator/POTTEVK.jpg
profession: Executive Director of Development - Utah State University

id: JOHNSDN
formatName: Dan N. Johnson
email: dnjohnson@le.utah.gov
address: 526 W 600 S, LOGAN, UT, 84321
image: https://le.utah.gov/images/legislator/JOHNSDN.jpg
profession: Retired educator

id: SNIDEC
formatName: Casey Snider
email: csnider@le.utah.gov
address: PO BOX 450, PARADISE, UT, 84328
image: https://le.utah.gov/images/legislator/SNIDEC.jpg
profession: Executive Director

id: MALOYC
formatName: A. Cory Maloy
email: corymaloy@le.utah.gov
address: 283 E 500 N, LEHI, UT, 84043
image: https://le.utah.gov/images/legislator/MALOYC.jpg
profession: Principal\Maloy PR

id: ANDERKR
formatName: Kyle R. Andersen
email: kyleandersen@le.utah.gov
address: 1257 E. 2250 N., NORTH OGDEN, UT, 84414
image: https://le.utah.gov/images/legislator/ANDERKR.jpg
profession: Retired

id: WALDRS
formatName: Steve Waldrip
email: swaldrip@le.utah.gov
address: 1911 N. 5700 E., EDEN, UT, 84310
image: https://le.utah.gov/images/legislator/WALDRS.jpg
profession: Real Estate Consulting

id: MUSSECR
formatName: Calvin R. Musselman
email: cmusselman@le.utah.gov
address: 4137 S 4100 W, WEST HAVEN, UT, 84401
image: https://le.utah.gov/images/legislator/MUSSECR.jpg
profession: Real Estate Sales

id: SHURTLL
formatName: Lawanna Shurtliff
email: lmshurtliff@le.utah.gov
address: 5085 AZTEC DR, OGDEN, UT, 84403
image: https://le.utah.gov/images/legislator/SHURTLL.jpg
profession: Retired Teacher

id: MILESKB
formatName: Kelly B. Miles
email: kmiles@le.utah.gov
address: 6288 S 1575 E, OGDEN, UT, 84405
image: https://le.utah.gov/images/legislator/MILESKB.jpg
profession: Attorney - Froerer and Miles, P.C.

id: SCHULM
formatName: Mike Schultz
email: mikeschultz@le.utah.gov
address: 4904 W 5850 S, HOOPER, UT, 84315
image: https://le.utah.gov/images/legislator/SCHULM.jpg
profession: Business

id: RAYP
formatName: Paul Ray
email: pray@le.utah.gov
address: PO BOX 977, CLEARFIELD, UT, 84089
image: https://le.utah.gov/images/legislator/RAYP.jpg
profession: Finance

id: LISONK
formatName: Karianne Lisonbee
email: karilisonbee@le.utah.gov
address: PO BOX 160152, CLEARFIELD, UT, 84016
image: https://le.utah.gov/images/legislator/LISONK.jpg
profession: Homemaker

id: WILSOBR
formatName: Brad R. Wilson
email: bradwilson@le.utah.gov
address: 350 N STATE ST SUITE 350, SALT LAKE CITY, UT, 84114
image: https://le.utah.gov/images/legislator/WILSOBR.jpg
profession: President, Destination Homes

id: HANDYSG
formatName: Stephen G. Handy
email: stevehandy@le.utah.gov
address: 1355 E 625 N, LAYTON, UT, 84040
image: https://le.utah.gov/images/legislator/HANDYSG.jpg
profession: Marketing Communications and Public Relations Consultant

id: BARLOSE
formatName: Stewart E. Barlow
email: sbarlow@le.utah.gov
address: 940 SIGNAL HILL, FRUIT HEIGHTS, UT, 84037
image: https://le.utah.gov/images/legislator/BARLOSE.jpg
profession: Physician and surgeon

id: HAWKETD
formatName: Timothy D. Hawkes
email: thawkes@le.utah.gov
address: 443 S 225 E, CENTERVILLE, UT, 84014
image: https://le.utah.gov/images/legislator/HAWKETD.jpg
profession: Public Interest Lawyer

id: WARDR
formatName: Raymond P. Ward
email: rayward@le.utah.gov
address: 954 E. MILLBROOK WAY, BOUNTIFUL, UT, 84010
image: https://le.utah.gov/images/legislator/WARDR.jpg
profession: Family Physician

id: BALLAMG
formatName: Melissa G. Ballard
email: mballard@le.utah.gov
address: 407 ELK HOLLOW CIRCLE, NORTH SALT LAKE, UT, 84054
image: https://le.utah.gov/images/legislator/BALLAMG.jpg
profession: Homemaker;, Pianist and Teacher; Former adjunct faculty, University of Utah

id: SAGERD
formatName: Douglas V. Sagers
email: dougsagers@le.utah.gov
address: 243 HOME TOWN CT, TOOELE, UT, 84074
image: https://le.utah.gov/images/legislator/SAGERD.jpg
profession: Healthcare Executive

id: DUCKWS
formatName: Susan Duckworth
email: sduckworth@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/DUCKWS.jpg
profession: Caregiver

id: HOLLIS
formatName: Sandra Hollins
email: shollins@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/HOLLIS.jpg
profession: Licensed Clinical Social Worker

id: DAILEJ
formatName: Jen Dailey-Provost
email: jdprovost@le.utah.gov
address: 812 N SANDHURST DR, SALT LAKE CITY, UT, 84103
image: https://le.utah.gov/images/legislator/DAILEJ.jpg
profession: Nonprofit Executive

id: BRISCJK
formatName: Joel K. Briscoe
email: jbriscoe@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/BRISCJK.jpg
profession: Labor Relations Consultant; High School Teacher (former)

id: ROMERAY
formatName: Angela Romero
email: angelaromero@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/ROMERAY.jpg
profession: Program Manager

id: BRAMMB
formatName: Brady Brammer
email: bbrammer@le.utah.gov
address: 1955 W GROVE PARKWAY, SUITE 250, PLEASANT GROVE, UT, 84062
image: https://le.utah.gov/images/legislator/BRAMMB.jpg
profession: Attorney

id: KINGBS
formatName: Brian S. King
email: briansking@le.utah.gov
address: 875 S DONNER WAY #1409, SALT LAKE CITY, UT, 84108
image: https://le.utah.gov/images/legislator/KINGBS.jpg
profession: Attorney

id: PERRYLB
formatName: Lee B. Perry
email: leeperry@le.utah.gov
address: 977 W 2390 S, PERRY, UT, 84302
image: https://le.utah.gov/images/legislator/PERRYLB.jpg
profession: Law enforcement

id: WINDEM
formatName: Mike Winder
email: mikewinder@le.utah.gov
address: 4165 S. 4400 W., West Valley City, UT 84120
image: https://le.utah.gov/images/legislator/WINDEM.jpg
profession: Banker, Business Consultant, Author

id: WEIGHE
formatName: Elizabeth Weight
email: elizabethweight@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/WEIGHE.jpg
profession: High School Teacher

id: HARRIS
formatName: Suzanne Harrison
email: sharrison@le.utah.gov
address: 1192 Draper Parkway 573, DRAPER, UT, 84020
image: https://le.utah.gov/images/legislator/HARRIS.jpg
profession: Physician Anesthesiologist

id: HALLHC
formatName: Craig Hall
email: chall@le.utah.gov
address: 3428 HARRISONWOOD DR, WEST VALLEY CITY, UT, 84119
image: https://le.utah.gov/images/legislator/HALLHC.jpg
profession: Attorney

id: KWANK
formatName: Karen Kwan
email: kkwan@le.utah.gov
address: PO BOX 571384, Murray, UT 84157-1384
image: https://le.utah.gov/images/legislator/KWANK.jpg
profession: Associate Professor

id: WHEATMA
formatName: Mark A. Wheatley
email: markwheatley@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/WHEATMA.jpg
profession: Education Administrator

id: ARENTPM
formatName: Patrice M. Arent
email: parent@le.utah.gov
address: 3665 E 3800 S, MILLCREEK, UT, 84109
image: https://house.utah.gov/wp-content/uploads/2019/01/IMG_0983.jpg
profession: Retired Attorney and Law School Professor; Business Manager and Marketing

id: MOSSCS
formatName: Carol Spackman Moss
email: csmoss@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://house.utah.gov/wp-content/uploads/2019/01/MOSSCS-1_edited.jpg
profession: High School Teacher (retired)

id: HUTCHEK
formatName: Eric K. Hutchings
email: ehutchings@le.utah.gov
address: 5438 W STONY RIDGE CIR, KEARNS, UT, 84118
image: https://le.utah.gov/images/legislator/HUTCHEK.jpg
profession: Renewable Energy / Financial Services

id: DUNNIJA
formatName: James A. Dunnigan
email: jdunnigan@le.utah.gov
address: 3105 W 5400 S STE 6, TAYLORSVILLE, UT, 84129
image: https://le.utah.gov/images/legislator/DUNNIJA.jpg
profession: Insurance Agency Owner

id: PITCHS
formatName: Stephanie Pitcher
email: spitcher@le.utah.gov
address: 2830 S GLENMARE ST, SALT LAKE CITY, UT, 84106
image: https://le.utah.gov/images/legislator/PITCHS.jpg
profession:

id: STRONMA
formatName: Mark A. Strong
email: mstrong@le.utah.gov
address: 2628 CLYDESDALE CIR, BLUFFDALE, UT, 84065
image: https://le.utah.gov/images/legislator/STRONMA.jpg
profession: Sales Representative

id: COLEMK
formatName: Kim F. Coleman
email: kimcoleman@le.utah.gov
address: 8303 S 5260 W, WEST JORDAN, UT, 84081
image: https://le.utah.gov/images/legislator/COLEMK.jpg
profession: Political Consultant, Social Media Marketing

id: ACTONCK
formatName: Cheryl K. Acton
email: cacton@le.utah.gov
address: 5143 W. Wheatcrest Circle, West Jordan, Utah 84081
image: https://le.utah.gov/images/legislator/ACTONCK.jpg
profession: Writer/Homemaker

id: STODDA
formatName: Andrew Stoddard
email: astoddard@le.utah.gov
address: 218 E 8135 S, SANDY, UT, 84070
image: https://le.utah.gov/images/legislator/STODDA.jpg
profession: City Prosecutor

id: ELIASS
formatName: Steve Eliason
email: seliason@le.utah.gov
address: 8157 S GRAMBLING WAY, SANDY, UT, 84094
image: https://le.utah.gov/images/legislator/ELIASS.jpg
profession: Financial Manager, University of Utah Hospital and Clinics

id: POULSMH
formatName: Marie H. Poulson
email: mariepoulson@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah, 84114
image: https://le.utah.gov/images/legislator/POULSMH.jpg
profession: Teacher

id: IVORYK
formatName: Ken Ivory
email: kivory@le.utah.gov
address: 8393 S 2010 W, WEST JORDAN, UT, 84088
image: https://house.utah.gov/wp-content/uploads/2019/01/47_Ivory.jpg
profession: Attorney/Mediator

id: STRATKJ
formatName: Keven J. Stratton
email: kstratton@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah 84114
image: https://le.utah.gov/images/legislator/STRATKJ.jpg
profession: Attorney, Businessman, Farmer

id: SPENDRM
formatName: Robert M. Spendlove
email: rspendlove@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah 84114
image: https://le.utah.gov/images/legislator/SPENDRM.jpg
profession: Economist

id: PULSIS
formatName: Susan Pulsipher
email: susanpulsipher@le.utah.gov
address: 1179 CHAPEL RIDGE RD, SOUTH JORDAN, UT, 84095
image: https://le.utah.gov/images/legislator/PULSIS.jpg
profession: Homemaker, Education

id: STENQJ
formatName: Jeffrey D. Stenquist
email: jstenquist@le.utah.gov
address: 1192 DRAPER PAARKWAY 551, DRAPER, UT, 84020
image: https://le.utah.gov/images/legislator/STENQJ.jpg
profession: Software Engineer

id: KNOTWJ
formatName: John Knotwell
email: jknotwell@le.utah.gov
address: 5328 W SHOOTERS RIDGE CIR, HERRIMAN, UT, 84096
image: https://le.utah.gov/images/legislator/KNOTWJ.jpg
profession: CEO of Utah Technology Council

id: WILDEL
formatName: Logan Wilde
email: loganwilde@le.utah.gov
address: 2250 N 7000 E, CROYDON, UT, 84018
image: https://le.utah.gov/images/legislator/WILDEL.jpg
profession: Rancher

id: QUINNT
formatName: Tim Quinn
email: tquinn@le.utah.gov
address: 1882 S 4800 E, HEBER CITY, UT, 84032
image: https://le.utah.gov/images/legislator/QUINNT.jpg
profession: Owner of Orasi

id: CHEWSH
formatName: Scott H. Chew
email: scottchew@le.utah.gov
address: PO BOX 126, JENSEN, UT, 84035
image: https://le.utah.gov/images/legislator/CHEWSH.jpg
profession: Rancher

id: CHRISKJ
formatName: Kay J. Christofferson
email: kchristofferson@le.utah.gov
address: 1256 E 1500 N, LEHI, UT, 84043
image: https://le.utah.gov/images/legislator/CHRISKJ.jpg
profession: Civil Engineer, Horrocks Engineers

id: HAWKIJ
formatName: Jon Hawkins
email: jhawkins@le.utah.gov
address: 1536 E 300 S, PLEASANT GROVE, UT, 84062
image: https://le.utah.gov/images/legislator/HAWKIJ.jpg
profession: Software Sales, Workfront

id: OWENSD
formatName: Derrin R. Owens
email: derrinowens@le.utah.gov
address: PO BOX 127, FOUNTAIN GREEN, UT, 84632
image: https://le.utah.gov/images/legislator/OWENSD.jpg
profession: School Counselor

id: PETERVL
formatName: Val L. Peterson
email: vpeterson@le.utah.gov
address: 528 W 1160 N, OREM, UT, 84057
image: https://le.utah.gov/images/legislator/PETERVL.jpg
profession: Higher Education Administration

id: DAWBM
formatName: Brad M. Daw
email: bdaw@le.utah.gov
address: 842 E 280 S, OREM, UT, 84097
image: https://le.utah.gov/images/legislator/DAWBM.jpg
profession: Software Engineer

id: JUDKIM
formatName: Marsha Judkins
email: mjudkins@le.utah.gov
address: 838 N 2400 W, PROVO, UT, 84601
image: https://le.utah.gov/images/legislator/JUDKIM.jpg
profession: Adjunct Professor at UVU in Developmental Math

id: SEEGMTM
formatName: Travis M. Seegmiller
email: tseegmiller@le.utah.gov
address: 308 W TABERNACLE ST STE 300, ST GEORGE, UT, 84770
image: https://le.utah.gov/images/legislator/SEEGMTM.jpg
profession: Professor\Attorney

id: ROBERA
formatName: Adam Robertson
email: adamrobertson@le.utah.gov
address: 1684 N 1500 E, PROVO, UT, 84604
image: https://le.utah.gov/images/legislator/ROBERA.jpg
profession: Chief Technology Officer, co-founder, Fortem Technologies Inc.

id: THURSNK
formatName: Norman K. Thurston
email: normthurston64@gmail.com
address: 965 E CENTER STREET, PROVO, UT, 84606
image: https://le.utah.gov/images/legislator/THURSNK.jpg
profession: Economist

id: GIBSOFD
formatName: Francis D. Gibson
email: fgibson@le.utah.gov
address: 208 S 680 W, MAPLETON, UT, 84664
image: https://house.utah.gov/wp-content/uploads/2019/01/Gibson.jpg
profession: Health Care Administrator

id: MCKELMK
formatName: Michael K. McKell
email: mmckell@le.utah.gov
address: 642 KIRBY LANE STE 105, SPANISH FORK, UT, 84660
image: https://house.utah.gov/wp-content/uploads/2019/01/MCKELMK.jpg
profession: Attorney; Title Officer

id: ROBERMK
formatName: Marc K. Roberts
email: mroberts@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah 84114
image: https://le.utah.gov/images/legislator/ROBERMK.jpg
profession: Merchant Services Executive, Real Estate Development, Consulting, Businessman

id: NELSOMF
formatName: Merrill F. Nelson
email: mnelson@le.utah.gov
address: 164 S 800 E, GRANTSVILLE, UT, 84029
image: https://le.utah.gov/images/legislator/NELSOMF.jpg
profession: Attorney

id: WATKICF
formatName: Christine F Watkins
email: christinewatkins@le.utah.gov
address: 1548 E 5700 S, PRICE, UT, 84501
image: https://le.utah.gov/images/legislator/WATKICF.jpg
profession: Retired Educator, Charter School Administrator, Labor Relations

id: ALBRECR
formatName: Carl R. Albrecht
email: carlalbrecht@le.utah.gov
address: 350 North State, Suite 350, Salt Lake City, Utah 84114
image: https://le.utah.gov/images/legislator/ALBRECR.jpg
profession: Retired Utility Executive

id: LASTBG
formatName: Bradley G. Last
email: blast@le.utah.gov
address: 1194 S 180 W, HURRICANE, UT, 84737
image: https://le.utah.gov/images/legislator/LASTBG.jpg
profession: Vice President, Development, Dixie State University

id: SHIPPRP
formatName: Rex P. Shipp
email: rshipp@le.utah.gov
address: 749 S ST JAMES PLACE, CEDAR CITY, UT, 84720
image: https://le.utah.gov/images/legislator/SHIPPRP.jpg
profession: Financial Adviser

id: LYMANP
formatName: Phil Lyman
email: plyman@le.utah.gov
address: 333 S MAIN ST, BLANDING, UT, 84511
image: https://le.utah.gov/images/legislator/LYMANP.jpg
profession: Accountant

id: SNOWVL
formatName: V. Lowry Snow
email: vlsnow@le.utah.gov
address: 912 W 1600 S SUITE B-200, ST GEORGE, UT, 84770
image: https://le.utah.gov/images/legislator/SNOWVL.jpg
profession: Attorney

id: BROOKW
formatName: Walt Brooks
email: wbrooks@le.utah.gov
address: 393 W 300 N, ST GEORGE, UT, 84770
image: https://le.utah.gov/images/legislator/BROOKW.jpg
profession: Business owner

PRO: API curated.co, Access to JSON (sending Token) and generate CPT

Task:
Get data from curated.co via it’s API


Solution:

[jsoncontentimporterpro url=https://api.curated.co/PUBLICATION_KEY/api/v1/issue method=curlget method=curlget curloptions='CURLOPT_HTTPHEADER=Accept:application/json##Authorization:Token token=YOUR_API_KEY##Content-type:application/json' parser=twig332adj]
issues: {{issues|length}}
{% for i in issues %}
{{i.published_at}}: </code></code><a href="{{i.url}}" target="_blank" rel="noopener">title: {{i.title}}</a><code>
{% endfor %}
[/jsoncontentimporterpro]

curated.co gives you a list of “issues”. You can generate for each issue a “WordPress-page” (aka “Custom Post Type” or “Custom Post Page”) -for that you need:

  • A JCI-template:
    There are all information on how to connect the API and what data is displayed at the generated pages.
    Name: pattern-template
    URL: https://api.curated.co/PUBLICATION_KEY/api/v1/issue method=curlget method=curlget
    curloptions:
Accept:application/json##Authorization:Token token=YOUR_API_KEY##Content-type:application/json

twig-template:

summary: {{summary}}
number: {{number}}
title: {{title}}
url: {{url}}
published_at{{published_at | date("d.m.y, H:i")}}
  • A new “Custom Page Type” (CPT):
    At the JCI-Options, Tab “Custom Post Types” there is “JCI-own way: Create JCI-Custom Post Types”. With this you can create a new CPT. You’re free to do this with many other Plugiins.
    Add the following at “JCI-own way: Create JCI-Custom Post Types”, save it an reload the page. Then there should be a new menu-entry “curatedname” (change ptname if you like).
    Importaint: The “Permalink Settings” of the WordPress must be at “Post name” reloaded to register this new CPT. Check that at the general WordPress “Settings” > “Permalinks”
type=curatedtype;ptredirect=curatedredirect;ptname=curatedname;key=wqekjqw4758327
  • A WordPress-Page called “generating-page”: This page is in the generating-page with a special JCI-Shortcode. Every time it is called, existing pages are deleted and new pages are created.
    • “loop” is the JSON-path to the list of issues in the JSON: Other JSON, other value here!
[jsoncontentimporterpro nameoftemplate=pattern-template mode=create createoptions='{"type":"curatedtype", "loop":"issues", "title":"Issue-number: {{number}}", "slugname": "slugname{{number}}", "deleteold":"yes"}']

Preview the “generating-page”:
There should be “start looping” where the issues are used for generating pages.
The generated pages do have URLs like “…/curatedredirect/slug179/”: “curatedredirect” is the value of “ptredirect” (change as you like), “slug{{number}}” comes from the “createoptions”-JSON in the Shortcode of the generating-page. Same is with the title of the page: “Issue-number: {{number}}”

If the Clikc on a generated Page gives a “page not found”-error: The “Permalink Settings” of the WordPress must be at “Post name”. Check that at the general WordPress “Settings” > “Permalinks”

twig: calculate and sort JSON-data

If you want to sort and calc JSON-data the PRO-Version is needed.


Example-JSON: http://api.json-content-importer.com/extra/json/twig-calc.json


{
"duel_id": 2, "name": "john",
"xp": 5214, "level": 8,
"xp_percentage": 0.56247, "games": 12,
"wins": 6,
"champions": [
{
"champions_id": 25, "champions_name_key": "hero",
"damagedealt": "317", "damagetaken": "458",
"matchtime": 612, "games": 98,
"wins": 2, "xp": 234
},
{
"champions_id": 2775, "champions_name_key": "htgjero",
"damagedealt": "31777", "damagetaken": "5458",
"matchtime": 6512, "games": 958,
"wins": 52, "xp": 2354
}]}

JCI-Template:

  • name: calctwig
  • URL: see above
  • twig-template:
xp: {{xp}}, xp_percentage: {{xp_percentage}}<hr>
{% for ch in champions |reverse(champions_id) %}
champions_id: {{ch.champions_id}}<br>
champions.matchtime: {{ch.matchtime}}<br>
({% set mt_min= (ch.matchtime/60)|round %}
min: {{mt_min}} sec: {{ch .matchtime-60*mt_min}})<hr>
{% endfor %}

Shortcode:

[jsoncontentimporterpro nameoftemplate="calctwig"]

In action:

xp: 5214, xp_percentage: 0.56247
champions_id: 2775
champions.matchtime: 6512
(min: 109 sec: -28)
champions_id: 25
champions.matchtime: 612
(min: 10 sec: 12)

Free & PRO for bitvalor.com API

Task: Display data from https://api.bitvalor.com/v1/ticker.json

Local stored JSON: http://api.json-content-importer.com/extra/json/bitvalorticker.json

Free JCI-Plugin Shortcode:

[jsoncontentimporter url=https://api.bitvalor.com/v1/ticker.json basenode=ticker_24h] 
total.last: {subloop:total:-1}{total.last}{/subloop:total}
[/jsoncontentimporter]

twig-template:

total.last: {{ticker_24h.total.last}}<br>
{% for key, val in ticker_24h.exchanges %} 
{{key}}: {{val.high}}<br>
{% endfor %} <br>
Mercado Bitcoin = R$ {{ticker_1h.exchanges.MBT.last}}

Shortcode (convertjsonnumbers2strings=yes needed here, as numbers are extra-long):

[jsoncontentimporterpro nameoftemplate="bitvalor" convertjsonnumbers2strings=yes]

PRO in Action:

total.last: 205343.02338294176
MBT: 208000
BSQ: 211282.882

Mercado Bitcoin = R$ 205333.33