One thing I wanted to do on the new seanreiser.com was have flickr sets as first class nodes. Nothing against the way the flickr module and flickr sets module creates a page flickr sets page, I just wanted something a little different. Quite frankly I wanted access to all the viewsy goodness drupal can give. Also as flickr doesn't provide an RSS for flickrsets I can have Drupal provide it for me.
As the flickr + flickrsets module provides a flickr CCK field which supports sets so that's good. The issue was importing all the sets I've already created. I threw together a quick script and figured I'd post it here:
$sets = flickr_photoset_get_list($flickr_nsid);
foreach ($sets as $set){
$sid=$set['id'];
$info = flickr_photoset_get_info($sid);
$primary = flickr_photo_get_info($info['primary']);
$newnode = new stdClass();
$newnode->type = 'photoset';
$newnode->title = $info['title']['_content'];
$newnode->body = $info['description']['_content'];
$newnode->name = 'sreiser';
$newnode->field_photoset = array(0 => array ('type' => 'set_id', 'id' => $sid));
$newnode->created = $primary['dateuploaded']; // As there is not date created for the set, I'm using the key photo
$newnode->uid = 1;
$newnode->status = 1;
$newnode->active = 1;
$newnode->promote = 1;
node_save($newnode);
}
Sean Reiser, 40, is a developer, technologist, and amateur photographer. Sean has spent the past 20 years as a programmer, system architect and development manager. He is a life long New York resident.
Sean currently serves as the President and Chief Geek Officer of Repair Sense, Inc.. Please go to that site with any professional inquiries.
Sean can be found using a number of social networks. These are the ones he's most active on: