1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
<style type="text/css">
#profilecrib_form{
background-color:#a6caf0;
width:240px;
}</style>
<?php
//authenticate with profilecrib and grab all comments on profile
$topic_id='100003739';//PUT YOUR PROFILECRIB TOPIC ID HERE
?>
<div id='profilecrib_form'><form action="#" method="post">username
<input type="text" name="username" /><br>
password<input type="password" name="password"/><br>
status<textarea name='comment'></textarea><br>
<input type="submit" value="Add Status"/>
<img src="http://dev.profilecrib.com/docs1/logos/pc33.png" /></form></div>
<?php
//SIMPLE PROFILECRIB CONNECT API CALL STATUS ADD EXAMPLE 3
//authenticating through curl username and password auth type,then adding a status
if(isset($_POST['comment'])){
//define some details for the api call
$client=$_SERVER['HTTP_HOST'];//client
$user_agent="profile";//put user agent here for profilecrib recognition
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'profilecrib api bot');
curl_setopt($ch, CURLOPT_URL, "http://profilecrib.com/api/api_basic/index.php");
//1 of profilecrib's api url's
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
'username' => $_POST['username'],//profilecrib username or email
'password' => $_POST['password'],//profilecrib password
'comment' => $_POST['comment'],//STATUS--comment-- MESSAGE TO ADD
'client' =>$client,
'user_agent' =>$client,
'topic_id' =>$topic_id//topic id |or user own status add
);
$username=$_POST['username'];
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$auth_message = curl_exec($ch);
$info = curl_getinfo($ch);
echo $auth_message;
//echo"<br>check your profile here and see if it has
//worked--><a href=http://profilecrib.com/$username>profilecrib.com/$username</a>";
//curl_close($ch);
//curl still open can close if you want or can grab some parameters .
}
else{
//echo'username or password not set';
}
//.end of adding to comments
//SIMPLE PROFILECRIB CONNECT API CALL STATUS ADD EXAMPLE 3
//authenticating through curl username and password auth type,then adding a status
//define some details for the api call
$client=$_SERVER['HTTP_HOST'];//client
$user_agent="profile";//put user agent here for profilecrib recognition
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'profilecrib api bot');
curl_setopt($ch, CURLOPT_URL, "http://profilecrib.com/api/api_basic/api1.php");
//1 of profilecrib's api url's
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
'username' => 'dev1',//profilecrib username or email
'password' => 'dev1',//profilecrib password
'status' => $_POST['status'],//STATUS MESSAGE TO ADD
'topic_id' =>$topic_id,
'client' =>$client,
'profile' =>$client,
'user_agent' =>$client
);
$username=$_POST['username'];
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$auth_message = curl_exec($ch);
$info = curl_getinfo($ch);
echo $auth_message;//'auth id here:'.$auth_id;
//echo"<br>check your profile here and see if it has
//worked--><a href=http://profilecrib.com/$username>profilecrib.com/$username</a>";
//curl_close($ch);
//curl still open can close if you want or can grab some parameters .
?>
|