To learn more about using non-PHP proxy languages, take a look at the Web Application Server tutorial.
2Create a new
.html file and save it as
index.html into a folder where you'll save the rest of your project files.
3Create a new
.php file and save it as
proxy-server.php into the same project folder as your
5Change the name of the resulting folder to
js-sdk and move it into the same folder as your
6Download the latest Temboo PHP SDK and unzip the file.
7Change the name of the resulting folder to
php-sdk and move it into the same folder as your
index.html file. Your project folder should look similar to the screenshot below:
9Fill in the Address input. You can put a full address, partial address or even a simple zip code.
10Click Generate Code to test the Choreo from our website, and you'll see a response appear in the Output section just like the screenshot below.
12Select PHP from the Proxy Code dropdown menu, then copy and paste code snippet into your
index.html file, make sure that your script source points to the correct location of the
temboo.js SDK file.
14In the same file, we'll also want to confirm that the location of our proxy is correctly specified. Our server is
// Instantiate the client proxy with the URI of your server proxy var temboo = new TembooProxy('proxy-server.php');
proxy-server.php file, make sure that the
require_once line points to the correct location of the PHP SDK file in the
php-sdk folder that you downloaded earlier.
16Run your PHP server.
18Seeing all of that data returned to the console is great, but now let's display the temperature on our page in the browser. All we have to do is change a couple of
consol.log lines in our
index.html file. Replace the
console.log(name + ': ' + outputs[name]); lines with the following:
document.write(name + ': ' + outputs[name]);
19Refresh the page and after a moment, you should see the Yahoo! Weather Forecast for the week! Now you can add styling or interactivity as you like.
20Here's the full code:
We're all finished! Where can we take this next? How about trying to create a form where people can search for the forecast for another address. Or try bringing in another Choreo. Check out the 2000+ other Choreos in the Library for some more ideas.
Once you've got your code up and running, you're ready to move on and do more. From monitoring your running applications, to moving your generated Temboo code to your preferred development environment and sharing it with colleagues, collaborators and friends - we've got you covered.
We're always happy to help. Just email us at email@example.com, and we'll answer your questions.