PHP Classes

File: test_term_extract.php

Recommend this page to a friend!
  Classes of Md Emran Hasan   HTTP client class   test_term_extract.php   Download  
File: test_term_extract.php
Role: Example script
Content type: text/plain
Description: Test file showing invoking Yahoo Term Extraction API.
Class: HTTP client class
Access Web resources via HTTP with sockets or Curl
Author: By
Last change:
Date: 16 years ago
Size: 524 bytes
 

Contents

Class file image Download
<?php

// Include the Http Class
include_once('class.http.php');

// Instantiate it
$http = new Http();

// Set API parameters
$http->addParam('appid' , 'a_really_random_yahoo_app_id');
$http->addParam('context' , 'I am happy because I bought a new car');
$http->addParam('output' , 'xml');

// Get the extracted term
$http->execute('http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction');

// Show result xml or error if occurred
echo ($http->error) ? $http->error : $http->result;

?>