From acf38a634ab0f5530ca5f0b15bc4c474b1091195 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 8 Jul 2013 15:09:09 +0200 Subject: updated temboo examples --- .../ToxicFacilitiesSearch.ino | 32 ++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) (limited to 'libraries/Bridge/examples/Temboo/ToxicFacilitiesSearch/ToxicFacilitiesSearch.ino') diff --git a/libraries/Bridge/examples/Temboo/ToxicFacilitiesSearch/ToxicFacilitiesSearch.ino b/libraries/Bridge/examples/Temboo/ToxicFacilitiesSearch/ToxicFacilitiesSearch.ino index a99803a..e7d4e5e 100644 --- a/libraries/Bridge/examples/Temboo/ToxicFacilitiesSearch/ToxicFacilitiesSearch.ino +++ b/libraries/Bridge/examples/Temboo/ToxicFacilitiesSearch/ToxicFacilitiesSearch.ino @@ -20,10 +20,7 @@ */ #include -#include -#include -#include -#include +#include #include "TembooAccount.h" // contains Temboo account information // as described in the footer comment below @@ -51,35 +48,30 @@ void loop() Serial.println("Running ToxicFacilitiesSearch - Run #" + String(numRuns++) + "..."); // we need a Process object to send a Choreo request to Temboo - Process FacilitiesSearchByZipChoreo; + TembooChoreo FacilitiesSearchByZipChoreo; // invoke the Temboo client - FacilitiesSearchByZipChoreo.begin("temboo"); + // NOTE that the client must be reinvoked and repopulated with + // appropriate arguments each time its run() method is called. + FacilitiesSearchByZipChoreo.begin(); // set Temboo account credentials - FacilitiesSearchByZipChoreo.addParameter("-a"); - FacilitiesSearchByZipChoreo.addParameter(TEMBOO_ACCOUNT); - FacilitiesSearchByZipChoreo.addParameter("-u"); - FacilitiesSearchByZipChoreo.addParameter(TEMBOO_APP_KEY_NAME); - FacilitiesSearchByZipChoreo.addParameter("-p"); - FacilitiesSearchByZipChoreo.addParameter(TEMBOO_APP_KEY); + FacilitiesSearchByZipChoreo.setAccountName(TEMBOO_ACCOUNT); + FacilitiesSearchByZipChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME); + FacilitiesSearchByZipChoreo.setAppKey(TEMBOO_APP_KEY); // identify the Temboo Library choreo to run (EnviroFacts > Toxins > FacilitiesSearchByZip) - FacilitiesSearchByZipChoreo.addParameter("-c"); - FacilitiesSearchByZipChoreo.addParameter("/Library/EnviroFacts/Toxins/FacilitiesSearchByZip"); + FacilitiesSearchByZipChoreo.setChoreo("/Library/EnviroFacts/Toxins/FacilitiesSearchByZip"); // set choreo inputs; in this case, the US zip code for which to retrieve toxin release data // the Temboo client provides standardized calls to 100+ cloud APIs - FacilitiesSearchByZipChoreo.addParameter("-i"); - FacilitiesSearchByZipChoreo.addParameter("Zip:" + US_ZIP_CODE); + FacilitiesSearchByZipChoreo.addInput("Zip", US_ZIP_CODE); // specify two output filters, to help simplify the Envirofacts API results. // see the tutorials on using Temboo SDK output filters at http://www.temboo.com/arduino - FacilitiesSearchByZipChoreo.addParameter("-o"); - FacilitiesSearchByZipChoreo.addParameter("fac:FACILITY_NAME:Response"); + FacilitiesSearchByZipChoreo.addOutputFilter("fac", "FACILITY_NAME", "Response"); - FacilitiesSearchByZipChoreo.addParameter("-o"); - FacilitiesSearchByZipChoreo.addParameter("addr:STREET_ADDRESS:Response"); + FacilitiesSearchByZipChoreo.addOutputFilter("addr", "STREET_ADDRESS", "Response"); // run the choreo unsigned int returnCode = FacilitiesSearchByZipChoreo.run(); -- cgit v1.2.3-18-g5258