Skip to content

Instantly share code, notes, and snippets.

@brianherbert
Created October 10, 2011 13:47
Show Gist options
  • Select an option

  • Save brianherbert/1275378 to your computer and use it in GitHub Desktop.

Select an option

Save brianherbert/1275378 to your computer and use it in GitHub Desktop.
example upload file from ushahidi using viddler
<?php
$viddler = new ViddlerV2($this->api_key);
$user = $viddler->viddler_users_auth(array('user'=>$this->username, 'password'=>$this->password));
$filename = upload::save('incident_video_file');
$params = array(
'sessionid'=>$user['auth']['sessionid'],
'title'=>'thisisatest'.rand(0,9999),
'tags'=>'tag1,tag2,tag3',
'description'=>'desc here dude',
'file'=>'@'.$filename
);
// Prepare and upload the video
$prepare = $viddler->viddler_videos_prepareUpload(array('sessionid' => $user['auth']['sessionid']));
$results = $viddler->viddler_videos_upload($params, $prepare['upload']['endpoint']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment