Class Golem_Api_Article_Top

Description

Class for accessing a list of top articles via web interface.

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


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

Top article data

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

Developer access key

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

Amount of top articles to fetch

  • access: protected
Methods
Constructor __construct (line 89)

Creates the TopArticle object

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

Does the request to get the top list.

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_Top::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
  • leadimg - Array - headline image
    • url - String - image URL
    • height - Integer - image height
    • width - Integer - image width

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

Error code for an invalid limit value

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

Base url of the webservice

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