CodeIgniter Forums
Twitter and XMLRPC - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Twitter and XMLRPC (/thread-19156.html)



Twitter and XMLRPC - El Forum - 05-29-2009

[eluser]bagwaa[/eluser]
Hi There,

I am attempting to-do something very simple, or so I thought - but I am having a problem, and I have a feeling this is something on my own part that I am doing wrong.

Basically, I want to learn about using API's and connecting to external services such as digg and twitter using the xmlrpc lib in CI.

I have created a basic controller and as I understood it, this would allow me to connect, is there anything strikingly wrong with this?

Code:
$server_url = "http://twitter.com/users/show/bagwaa.xml";

$this->xmlrpc->set_debug(TRUE);
$this->xmlrpc->server($server_url, 80);
$this->xmlrpc->method('users/show');

$request = array('http' => 'GET');
$this->xmlrpc->request($request);

if (!$this->xmlrpc->send_request()) {
    $data["response"] = $this->xmlrpc->display_error();
} else {
    $data["response"] = $this->xmlrpc->display_response();
}

Apologies if this seems obvious but I just can't see the problem, and if you can point me in the right direction to figure this out it would be appreciated.

bagwaa


Twitter and XMLRPC - El Forum - 05-29-2009

[eluser]pistolPete[/eluser]
The XML you get from the twitter URL above is just plain XML, not XML-RPC.
If you want to parse the XML data, use e.g. SimpleXML.