/[drupal]/contributions/modules/votesmart/votesmart.api.inc
ViewVC logotype

Diff of /contributions/modules/votesmart/votesmart.api.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Wed Aug 6 00:27:37 2008 UTC revision 1.2, Sun Aug 10 01:42:51 2008 UTC
# Line 1  Line 1 
1  <?php // $Id$  <?php // $Id: votesmart.api.inc,v 1.1 2008/08/06 00:27:37 vauxia Exp $
2    
3  function _votesmart_api($request, $args = array(), $item = null) {  function _votesmart_api($request, $args = array(), $item = null) {
4    $key = variable_get('votesmart_key', '');    $key = variable_get('votesmart_key', '');
# Line 15  function _votesmart_api($request, $args Line 15  function _votesmart_api($request, $args
15    $res = drupal_http_request($url);    $res = drupal_http_request($url);
16    $ret = (array) new SimpleXMLElement($res->data, LIBXML_NOCDATA);    $ret = (array) new SimpleXMLElement($res->data, LIBXML_NOCDATA);
17    
18      // TODO check $ret['errorMessage']
19    
20    // Return specified element (e.g. 'details', 'list', etc.);    // Return specified element (e.g. 'details', 'list', etc.);
21    if ($item) return $ret[$item];    if ($item) return $ret[$item];
22    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2