General Musing

blaze your trail

Posts Tagged ‘xsl

Figuring out PHP DOMDocument and XSLTProcessor #php

with one comment

Although I calculate the period I’ve been programming in decades, I am a relative PHP newbie. I’m testing and playing with PHP and writing distributed services, yet it’s sometimes the simple knowledge that I’m missing. (How does this Object perform the function that I want.) So I’ve been playing with the XML Classes in PHP and modified so code from PHP + Twitter + Google Calendar + SMS
. The article is quite interesting, and I discovered the Zend Framework, which makes my life much easier. 🙂

// Define credentials for the Twitter account

// Set up CURL with the Twitter URL and some options
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘;);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Twitter uses HTTP authentication, so tell CURL to send our Twitter account de

// Execute the curl process and then close
$data = curl_exec($ch);


// Load XML
$dom = new DOMDocument();
$dom->loadXML(print_r($data, true));

// Load XSL:
$filename = “rss.xsl”; // You can find an rss.xsl file lots of places.
$domxsl = new DOMDocument();
$xsltp = new XSLTProcessor();

// Apply XSL to XML
$result = $xsltp->transformToXML($dom);

// Output XSL Transformed XML
print ($result);

Technorati technorati tags: , , , ,


Written by Daniël W. Crompton (webhat)

October 17, 2008 at 11:45 am

Posted in programming

Tagged with , , , ,

Playing with Gnip (Proof of Concept)

with one comment

I mentioned Gnip before, and this afternoon I was browsing the API definition and wanted to see if I could add my own publisher.

First I wanted to see how the messages are polled, so I crafted a wget command to retrieve some example data:

wget -nv --http-user="*username*" --http-passwd="*password*"

Read the rest of this entry »

Written by Daniël W. Crompton (webhat)

July 10, 2008 at 7:55 pm

%d bloggers like this: