You are here

public function SocialContentSoundCloud::getRows in Social Content 7.2

Get the rows to import.

Parameters

mixed $last_id: The id of the last import.

Return value

array Array of rows.

Overrides SocialContent::getRows

File

modules/soundcloud/social_content_soundcloud.class.inc, line 180
Social Content SoundCloud class.

Class

SocialContentSoundCloud
@file Social Content SoundCloud class.

Code

public function getRows($last_id = NULL) {
  $settings = $this->settings['instance'];
  $global_settings = $this->settings['global'];
  $params = array(
    'client_id' => $global_settings['client_id'],
    'limit' => $settings['limit'],
    'linked_partitioning' => 1,
  );
  $url = 'http://api.soundcloud.com/users/' . $settings['account_id'] . '/tracks';
  $result = $this
    ->httpRequest(url($url, array(
    'query' => $params,
    'external' => TRUE,
  )));
  if ($result->code == 200) {
    $data = json_decode($result->data);
    return $data->collection;
  }
  return FALSE;
}