You are here

public function SocialContentPinterest::getRows in Social Content 7.2

Get the rows to import.

Parameters

mixed $last_id: The id of the last import.

Return value

mixed The array of the raws, or FALSE on error.

Overrides SocialContent::getRows

File

modules/pinterest/social_content_pinterest.class.inc, line 125
Social Content Pinterest class.

Class

SocialContentPinterest
@file Social Content Pinterest class.

Code

public function getRows($last_id = NULL) {
  $settings = $this->settings['instance'];
  $global_settings = $this->settings['global'];
  $url = $global_settings['api_url'];
  $url = str_replace('@user', $settings['user'], $url);
  $url = str_replace('@board', $settings['board'], $url);
  $response = drupal_http_request($url);
  $xml = simplexml_load_string($response->data);
  $json = json_encode($xml);
  $array = json_decode($json, TRUE);
  $rows = $array['channel']['item'];
  foreach ($rows as $key => $row) {
    $rows[$key] = (object) $row;
  }
  return $rows;
}