person_id= Options::get( 'flickrfill__person' ); echo "Dates in function: $post1date,$post2date"; /* Displays "Dates in function: ,1244048266" */ $request= new RemoteRequest( 'http://api.flickr.com/services/rest/?method=flickr.photos.search&format=rest&api_key=39b1bcf1b0c84a24435677252085d436&user_id=' . $this->person_id . '&min_date_taken=' . $post1date . '&max_date_taken=' . $post2date . '&sort=interestingness-desc&media=photos&per_page=5' ); $request->set_timeout( 5 ); $result= $request->execute(); if ( Error::is_error( $result ) ) { // this is a cronjob, so no sense displaying an error EventLog::log( 'Error getting photo from Flickr', 'err', 'default', 'habari' ); return; } $response= $request->get_response_body(); $xml= new SimpleXMLElement( $response ); if ( ! $xml ) { return; } $photo=$xml->photos->photo; if ( ! $photo ) { return; } if ( ! $photo['id'] ) { return; } echo ''; /*Options::set( 'skippyflickr__photo', $newphoto );*/ EventLog::log( 'Updated photo: ' . $photo['title'], 'info', 'default', 'habari' ); } ?>