Golem.de API

Golem  alpha

Golem.de API > Golem > Golem.Api.Video.Top

Class Golem.Api.Video.Top - extends Golem.Api

Get a list of the current top videos via Golem web interface


Golem.Api.Video.Top ( maxVideos )
maxVideos <Integer> the number of top videos


ERROR_LIMIT - {Integer}

Indicates, that the video limit is out of the valid range

TYPE - protected {String}

The type of access method for the web service

URL - protected {String}

The URL of the used web service



void each ( fnCallback , params )
Traverses through the video list.

After a succesful request you can traverse through the video list. You pass a callback function to the method, and the method is called for each video.

The first argument to this callback function is a video object with the properties:

  • videoid - {Integer} - The video identifier
  • title - {String(255)} - The video
  • url - {String} - The video URL
The second argument will be the data provided by params.

fnCallback <Function> - the callback function to call for each article
params <Mixed> - additional data passed to the callback function
Returns: void


void fetch ( obj )
Fetches the list of top videos via web service

In case of a successful request, the obj.fnSuccess-callback function will be called. The first argument for the callback method is the result data of the request. The second argument will be the data provided by obj.params.

In case of a failed request, the fnError callback function will be called. The first argument to the callback is the error code, the second ist the error message.

obj <Object> - Object literal specifing the callback methods
Returns: void


void fetchEach ( fnSuccess , params )
Shortcut method for traversing the video data

Fetches the videos via fetch() first and then calls fnSuccess for every article record like each() does.

There is no way to handle errors with this method!

fnSuccess <Function> - Function to call for every video record
params <Mixed> - additional data to pass to the callback function
Returns: void

Copyright © 2010 Golem.de.