Return to Snippet

Revision: 1550
at October 20, 2006 07:41 by jugyo


Updated Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<title>delicious_test</title>

<body>

<?php

	postBookmark("id", "pass", "title", "http://...", "comment...", "tags...");

	function postBookmark($account,$password,$title,$url,$comment,$tag="") {
		$title   = mb_convert_encoding($title, "UTF-8", "eucjp-win");
		$comment = mb_convert_encoding($comment, "UTF-8", "eucjp-win");
		$tag     = mb_convert_encoding($tag, "UTF-8", "eucjp-win");
		$url     = urlencode($url);
		$title   = urlencode($title);
		$comment = urlencode($comment);
		$tag     = urlencode($tag);
		$cmd     = 'curl --silent --user ' 
			. $account . ':' . $password 
			. ' -o "response.xml"'
			. ' -O "https://api.del.icio.us/v1/posts/add?url=' 
			. "$url&description=$title&extended=$comment&tags=$tag&" . '"';
		system($cmd);
	}
?>

</body>
</html>

Revision: 1549
at October 20, 2006 07:33 by jugyo


Initial Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<title>delicious_test</title>

<body>

<?php

	postBookmark("id", "pass", "title", "http://...", "comment...", "tags...");

	function postBookmark($account,$password,$title,$url,$comment,$tag="") {
			echo "test";
	        $title   = mb_convert_encoding($title, "UTF-8", "eucjp-win");
	        $comment = mb_convert_encoding($comment, "UTF-8", "eucjp-win");
	        $tag     = mb_convert_encoding($tag, "UTF-8", "eucjp-win");
	        $url     = urlencode($url);
	        $title   = urlencode($title);
	        $comment = urlencode($comment);
	        $tag     = urlencode($tag);
	        $cmd     = 'curl --silent --user ' . $account . ':' . $password . ' -o "response.xml" '.
	               '-O "https://api.del.icio.us/v1/posts/add?url=' . "$url&description=$title&extended=$comment&tags=$tag&" . '"';
			echo $cmd;
	        system($cmd);
	}
?>

</body>
</html>

Initial URL

                                

Initial Description
deliciousにポストするサンプル

Initial Title
delicious_test.php

Initial Tags
web, api

Initial Language
PHP