Class Golem_Api_Article_Latest

Description

Class for accessing the latest articles via web interface.

Located in /Api/Article/Latest.php (line 52)


	
			
Class Constant Summary
 ERROR_LIMIT = 102
 URL = 'http://api.golem.de/api/article/latest/'
Variable Summary
Array $articles
String $key
Integer $maxArticles
Method Summary
Golem_Api_Article_Latest __construct (String $key, [Integer $maxArticles = 10])
Boolean fetch ([Array $curlOptions = array()])
Array getArticles ()
Variables
Array $articles = array() (line 75)

Latest article data

  • access: protected
String $key = null (line 81)

Developer access key

  • access: protected
Integer $maxArticles = 10 (line 69)

Amount of top articles to fetch

  • access: protected
Methods
Constructor __construct (line 89)

Creates the Article_Latest object

  • access: public
Golem_Api_Article_Latest __construct (String $key, [Integer $maxArticles = 10])
  • String $key: your developer key
  • Integer $maxArticles: the number of latest articles to fetch
fetch (line 113)

Does the request to get the list of latest articles.

If the request was succesful, true will be returned, else an exception will be thrown.

The possible Exception codes are Golem_Request::DATABASE and Golem_Api_Article_Latest::ERROR_LIMIT.

After a successful request the article list is available from getArticles().

  • return: true, if request was successful
  • access: public
Boolean fetch ([Array $curlOptions = array()])
  • Array $curlOptions: optional options for cUrl
getArticles (line 152)

Returns the list of articles.

In the array, each entry represents a article record. The keys of record array are:

  • articleid - Integer - Article identifier
  • headline - String - Headline
  • abstracttext - String - article abstract
  • url - String - article URL
  • date - Integer - article publishing as unix timestamp
  • leadimg - Array - headline image
    • url - String - image URL
    • height - Integer - image height
    • width - Integer - image width

  • access: public
Array getArticles ()
Class Constants
ERROR_LIMIT = 102 (line 63)

Error code for an invalid limit value

URL = 'http://api.golem.de/api/article/latest/' (line 58)

Base url of the webservice

Documentation generated on Tue, 20 Apr 2010 14:21:07 +0200 by phpDocumentor 1.4.3