Skip to content

Instantly share code, notes, and snippets.

@peter279k
Last active Jun 26, 2016
Embed
What would you like to do?
plurk for testing
<?php
require "./plurk.php";
$qulifier='says';
$message="";
$img_path = "./pass.jpg";
$action_url = "http://www.plurk.com/APP/Timeline/plurkAdd";
$action_upload = "http://www.plurk.com/APP/Timeline/uploadPicture";
//發噗
//$post_info = do_action($action_url, array("content"=>rawurlencode($message),"qualifier"=>$qulifier));
$img = new CurlFile(realpath($img_path), "image/jpeg");
//$img = serialize($img);
$post_info = upload_img($action_upload, array("image" => rawurlencode(serialize($img))));
//var_dump($post_info);
if(!empty($post_info["error_text"])) {
if($post_info["error_text"] === "anti-flood-same-content") {
echo "Oops! you post the same contents.";
}
else {
echo $post_info["error_text"];
}
}
//回噗
if(!empty($post_info["plurk_id"])) {
echo $plurk_id = $post_info["plurk_id"];
}
//$reply="yeah! It looks awesome!";
//do_action("http://www.plurk.com/APP/Responses/responseAdd",
//array("content"=>rawurlencode($reply),"qualifier"=>$qulifier,"plurk_id"=>"1310159586"));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment