Brian "Krow" Aker (krow) wrote,
Brian "Krow" Aker
krow

Playing around with XMLValue

From IM:
"So can anything be done with XML?"

Create a table:

CREATE TABLE `krow` (
`a` varchar(125) NOT NULL DEFAULT '',
`b` text,
PRIMARY KEY (`a`)
) ENGINE=HTTP DEFAULT CHARSET=latin1 CONNECTION='http://krow.livejournal.com/data/'

Now... can I extract anything?

mysql> select EXTRACTVALUE(b, '/rss/channel/title') from krow WHERE a="rss";
+--------------------------------------------------+
| EXTRACTVALUE(b, '/rss/channel/title') |
+--------------------------------------------------+
| Brian "Krow" Aker's Idle Thoughts |
+--------------------------------------------------+
1 row in set (1.29 sec)

Basically I use the new XML methods in 5.1 to extract out realtime data from 5.1.

I publicly committed mod_methods:
http://hg.tangent.org/mod_methods

I would not enable it on a public server. I've never fixed the security for it, and its quite dangerous for that reason. It is handy for testing services like this since it has a plain GET/PUT/HEAD/DELETE method.
Subscribe
  • Post a new comment

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments