SimpleXML

Rob Loach's picture

getDOM

  1. function getDOM($url) {
  2.         $ch = curl_init ();
  3.         curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  4.         curl_setopt ($ch, CURLOPT_URL, $url);
  5.         curl_setopt ($ch, CURLOPT_TIMEOUT, 10);

scrape it up

  1.  $xml = simple_get_xml('http://www.cotrip.org/atis/web.TraveltimeMarshal');
  2.   $table = $xml->xpath('/html/body/table[3]');
  3.   foreach ($table[0]->tr as $item) {
  4.     if (count($item) == 1) {

Fix for Demo code to parse the Google SoC 2008 applications list available to mentors

  1. <?php
  2. /**
  3.  * Parse the Google SoC 2008 data available to mentors at
  4.  * http://code.google.com/soc/2008/drupal/open.html
  5.  * in order to include it in a Drupal app
  6.  *
  7.  

Demo code to parse the Google SoC 2008 applications list available to mentors

  1. <?php
  2. /**
  3.  * Parse the Google SoC 2008 available to mentors at
  4.  * http://code.google.com/soc/2008/drupal/open.html
  5.  * in order to include it in a Drupal app
  6.  *
  7.  
Syndicate content