Create a gist now

Instantly share code, notes, and snippets.

Kippt PHP Api integration
<?php
$data_url = "https://kippt.com/api/clips";
$ch = curl_init ($data_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$rawdata=curl_exec($ch);
curl_close ($ch);
$jsonData = json_decode($rawdata,true);
#print "<pre>";
#print_r($jsonData);
#print "</pre>";
for($i=0;$i<=count($jsonData['objects']);$i++){
print "<small class='label label-info'><i class='fa fa-clock-o'></i><a href='".$jsonData['objects'][$i]['url']."' target='_blank'> ".$jsonData['objects'][$i]['title']."</a></small><BR>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment