sasezakiの日記

 | 

2007-08-29

<?php
$file = "test2.jpg";
$email = 'test@test.org';
$password = 'jkondolove';

/////////////////////
require_once 'Zend/Http/Client.php';
require_once 'Pel/PelJpeg.php';

$jpeg = new PelJpeg($file);

$posts['email'] = $email;   
$posts['password'] = $password;
    //$posts['type'] = 'regular';
    //$posts['title'] = 'title';
    //$posts['body']  = 'bodybody';
$posts['type'] = 'photo';
$posts['data'] = $jpeg->getBytes();

$client = new Zend_Http_Client();
$client->setUri('http://www.tumblr.com/api/write');
$client->setParameterPost($posts);
        
$request  = $client->request('POST');
$response = $request->getStatus();

if ($response == 201){echo "success!";};

JimmieJimmie2012/07/27 16:08That hits the target perfeclty. Thanks!

qpxnnkrjqpxnnkrj2012/07/28 19:32Af5Lam , [url=http://psslzkqeskon.com/]psslzkqeskon[/url], [link=http://whglqgusxfge.com/]whglqgusxfge[/link], http://hzzawjbxcvvi.com/

pkmwslypkmwsly2012/07/29 07:386Gc6Y0 <a href="http://pjnnuxazcvdq.com/">pjnnuxazcvdq</a>

rznvvthdparznvvthdpa2012/07/30 14:46KEu414 , [url=http://ukhesypiajfg.com/]ukhesypiajfg[/url], [link=http://opkzimodszdf.com/]opkzimodszdf[/link], http://nvdsrmhqcoyu.com/

 |