HI i work on a plugin that insert post automatically, i made this:
$mItems = new ItemActions(false);
$your_item = array();
$tit = array();
$tit['it_IT'] = $title;
$your_item['title'] = $tit;
$desc = array();
$desc['it_IT'] = $description;
$your_item['description'] = $desc;
$your_item['contactName'] = $autor;
$your_item['contactEmail'] = $post_autor;
$your_item['active'] = 'ACTIVE';
$your_item['catId'] = $category;
$your_item['countryId'] = 'IT';
$your_item['regionId'] = getRegionIDbyName($region, $your_item['countryId']);
$your_item['cityId'] = getCityIDbyName($complete_province, $your_item['regionId']);
$your_item['cityArea'] = $city;
$your_item['address'] = null;
$your_item['showEmail'] = 0;
$your_item['countryName'] = $nation;
$your_item['regionName'] = $region;
$your_item['cityName'] = $complete_province;
$your_item['price'] = $price;
$your_item['meta_ext-link'] = $link;
$photoData = checkAndDownloadImg($image);
if ( !empty($photoData) && !empty($photoData['folder']) && !empty($photoData['name']) && !empty($photoData['ext']) ){
//se l immagine esiste
$name = array();
$name['name'] = array($photoData['name']);
$type = array();
$type['type'] = array('image/'.$photoData['ext']);
$tmp_name = array();
$tmp_name['tmp_name'] = array($photoData['folder']);
$error = array();
$error['error'] = array(0);
$size = array();
$size['size'] = array(30397);
$your_item['photos'] = array($name, $type, $tmp_name, $error, $size);
}
$mItems->data = $your_item;
$mItems->add();