Home « Server software «
Documentation: services/slashdot_codec.php
Class slashdot_Codec extends Codec - Encoder and decoder for slashdot messages
Messages
At the moment, this script gives following information for each resource:- title - the title of the article
- url - the absolute url to fetch the article
- time - the date and time of article last modification
- author - the last contributor to the article
- section - the label of the section from where the article is originated
- image - the absolute url to fetch a related image, if any
You will find below an excerpt of a real feed from slashdot:
<?xml version="1.0"?><backslash
xmlns:backslash="http://slashdot.org/backslash.dtd">
<story>
<title>Recording Industry Extinction Predicted RSN</title>
<url>http://slashdot.org/article.pl?sid=03/01/23/1236242</url>
<time>2003-01-23 17:00:05</time>
<author>michael</author>
<department>imminent-death-predictions-getting-boring</department>
<category>141</category>
<comments>107</comments>
<section>articles</section>
<image>categorymusic.gif</image>
</story>
...
<story>
<title>Using Redundancies to Find Errors</title>
<url>http://slashdot.org/article.pl?sid=03/01/23/0221242</url>
<time>2003-01-23 04:20:58</time>
<author>timothy</author>
<department>the-error-is-right-around-here</department>
<category>156</category>
<comments>270</comments>
<section>developers</section>
<image>categoryprogramming.gif</image>
</story>
</backslash>
This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
export() - Build a XML request according to the slashdot API
function export($service, $parameters)
- $service - array of $url => $attributes
- $parameters -
- returns an array of which the first value indicates call success or failure
Parameters is an array of $url => $attributes describing articles. Attributes are split according to the following syntax:
list($time, $title, $author, $section, $image, $description) = $attributes;
export_request() - Build a XML request according to the slashdot API
function export_request($service, $parameters)
- $service - string name of the remote service
- $parameters - array of $url => $attributes
- returns an array of which the first value indicates call success or failure
$result = $codec->export_request($service, $parameters);
Parameters is an array of $url => $attributes describing articles. Attributes are split according to the following syntax:
list($time, $title, $author, $section, $image, $description) = $attributes;
Voir aussi:
export_response() - Build a XML response according to the slashdot API
function export_response($values=NULL, $service=NULL)
- $values=NULL - array of $url => $attributes
- $service=NULL - string name of the remote service
- returns an array of which the first value indicates call success or failure
$result = $codec->export_response($values);
Parameters is an array of $url => $attributes describing articles. Attributes are split according to the following syntax:
list($time, $title, $author, $section, $image, $description) = $attributes;
Voir aussi:
import_request() - Parse a XML request
function import_request($data)
- $data - array the received $HTTP_RAW_POST_DATA
- returns array the service called and the related input parameters
import_response() - Decode a XML response
function import_response($data, $headers=NULL, $parameters=NULL)
- $data - string the received HTTP body
- $headers=NULL - string the received HTTP headers
- $parameters=NULL - mixed the submitted parameters
- returns an array of which the first value indicates call success or failure
parse_tag_open()
function parse_tag_open($parser, $tag, $attributes)
- $parser -
- $tag -
- $attributes -
parse_cdata()
function parse_cdata($parser, $cdata)
- $parser -
- $cdata -
parse_tag_close()
function parse_tag_close($parser, $tag)
- $parser -
- $tag -