title: Vimeo API Integration
body: <p>I am trying to create a site that uses the viemo api to search for videos and then output them in xml format. I was off to a good start but now I am stuck. The user input is posting but no results are showing up on the firebug console...</p>
  
  <p>Here is my .php for the vimeo api integration:</p>
  
  <pre><code>    &lt;?
  include('connect.php');
  
  $video_id= $_POST['text'];
  
  $url = 'http://vimeo.com/api/rest/v2';
  $url .= '?';
  $url .= 'method=vimeo.videos.search&amp;';
  $url .= 'oauth_consumer_key='.$api_key2.'&amp;';
  $url .= 'per_page=10&amp;';
  $url .= 'query='.$video_id.'&amp;';
  $url .= 'sort=relevant&amp;';
  $url .= 'full_response=1';
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  $curl_response = curl_exec($ch);
  curl_close($ch);
  
  
  $xmlObject = simplexml_load_string($curl_response);
  
  $title= 'title';
  $id = 'id';
  $video_url = 'videosurl';
  $thumbnails = 'thumbnail[1]';
  $outputXML .= "";
  
  $outputXML .= "&lt;rsp&gt;\n";
  
  foreach($xmlObject-&gt;videos as $video) {
      $videoTagBegin = "\t&lt;video&gt;\n";
      $urlXML = "\t\t&lt;videosurl&gt;".$video-&gt;attributes()-&gt;$video_url."&lt;/videosurl&gt;\n";
      $titleXML = "\t\t&lt;title&gt;".$video-&gt;attributes()-&gt;$title."&lt;/title&gt;\n";
      $thumbXML = "\t\t&lt;thumbnail&gt;".$video-&gt;attributes()-&gt;$thumbnails."&lt;/thumbnail&gt;\n";
      $videoTagEnd = "\t&lt;/video&gt;\n";
      $outputXML .= $videoTagBegin.$titleXML.$thumbXML.$urlXML.$videoTagEnd;
  }
  $outputXML .= "&lt;/rsp&gt;";
  
  print $outputXML;
  
  ?&gt;
  </code></pre>
  
  <p>Any help would be appreciated. I am completely stuck.</p>
  
  <p>This is my JS if it helps at all....</p>
  
  <pre><code>function closeDivs(e) {
      e.preventDefault();
      $('').empty();
  };
  
  $(document).ready(function() {
  
      $('#searchbtn').bind('click' || 'enter',function(e) {
          if ($.trim($('#searchBox').val()) !== '') {
              $('#videos').empty();
              closeDivs(e);
              $('#videos').append('&lt;img src="img/loading.gif" alt="loading" class="loading" /&gt;');
              getEvents(e);
              getVideos(e);
          }
      });
  
  function getEvents(e) {
      e.preventDefault();
      var text = 'event_id='+$('#searchBox').val();
      $.ajax({
          url: 'getEvents.php',
          dataType: 'xml',
          type: 'POST',
          data: text,
          success: function(data) {                   
              },
  
          error: function(data) {
                  console.log('Error: ' + data);
          }
  
      })
  };
  
  function getVideos(e) {
      e.preventDefault();
      var text = 'video_id='+$('#searchBox').val();
      $.ajax({
          url: 'getVideos.php',
          dataType: 'xml',
          type: 'POST',
          data: text,
          success: function(data) {                               
  
          },
          error: function(data) {
                  console.log('Error: ' + data);
          }
  
      })
  };
  });
  </code></pre>