Login   Register  
PHP Classes

File: test_term_extract.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 6 years ago
Size: 524 bytes


Class file image Download

// Include the Http Class

// 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

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