ܻؤ1顪30奵꡼ޥܥ

ITȤƯ30奵꡼ޥΥ饤ߥ󥰵Ͽ

2010ǯ02

zoomeư򥿥Ǹ

ǶΥưϤäѤzoomeǤ͡
̥礭̤礭ӥåȥ졼Ȥ⤤
˥ưήƤƤ褦˻פޤ
Ȥ櫓ǡzoomeΥPHPǡ

require_once 'XML/RPC.php';

$arr = array('tagname' => '',
             'offset' => 0,
             'length' => 10
             );
$params  = new XML_RPC_Value(array(
                                   'tagname' => new XML_RPC_Value($arr['tagname'], 'string'),
                                   'offset' => new XML_RPC_Value($arr['offset'], 'i4'),
                                   'length' => new XML_RPC_Value($arr['length'], 'i4'),
                                   ), "struct");

$msg = new XML_RPC_Message('zoome.tagSearch', array($params));
$cli = new XML_RPC_Client('/xmlrpc', 'up.zoome.jp', 80);
$res = $cli->send($msg);

if (!$res->faultCode()) {
  $data = XML_RPC_decode($res->value());
  /* "Total:". $data['count']; */
  foreach($data['list'] as $key => $val) {
    $zoome = array(
                   'zoomeid' => $val['zoomeid'],
                   'diaryid' => $val['diaryid'],
                   'title' => $val['title'],
                   'url' => $val['diaryurl'],
                   'body' => $val['body'],
                   );
  }
} else {
  exit('CODE:'.$res->faultCode(). ':'. $res->faultString());
}


ߤ򤤤ХȤۤǤ͡
ǥեȤǿȻפǤɡΥȤ餤Ϥۤʡ
¾ˤƤȤΥ᥽åɤΤǸɥȤ򻲾ȤƤߤƤ

͡zoome API(XML-RPC)ɥ
    Υȥ꡼ϤƤʥ֥åޡɲ

OpenIDǥ󤷤ơ˥å͡ϿƤ餦褦ʲ̤ǤΥХǡȥ⡣

usersơ֥nickname˥ХǡȤ򤫤


åܤ3ġ

  • ˡʥ˥å͡फ
  • ʸ⤫
  • ΤߤǤϤʤ

ΤߤϤfunction notSpaceǥå

APP/model/user.php

<?php
class User extends AppModel {
    var $name = 'User';
    var $validate = array(
        'nickname' => array(
                            'notSpace' => array(
                                                'rule' => array('notSpace'),
                                                'message' => 'ΤߤϿǤޤ'
                                                ),
                            'between' => array(
                                               'rule' => array('between', 1, 45),
                                               'message' => '1ʸʾϤƤ15ʸޤǡ'
                                               ),
                            'isUnique' => array(
                                                'rule' => 'isUnique',
                                                'message' => 'ǤϿƤޤ'
                                                ),
                            ),
        );
    function notSpace($field=array()) {
      foreach($field as $name => $value){
        if (preg_match("/^( |)+$/", $value)) {
          return false;
        } else {
          return true;
        }
      }
    }
}
?>
    Υȥ꡼ϤƤʥ֥åޡɲ

ʥ֥AtomAPIݤʤε
ϸƤäѤƱ褦˺äƤͤߤ

Ȥ櫓ǡפ֤Ĵľ
ΥȰ㤦ʬԥååס
äѤWSSEǧݥȤǤ줵̤ФȤϤʤꡣ


$nonce = sha1(md5(time()));


ʸ鲿Ǥ⤤Ȥϻפɡ


$pass_digest = base64_encode(pack('H*', sha1($nonce.$created.strtolower(md5($password)))));


դä
ʸˤ󤸤ʤʸˤ롣


Ȥgetǵη̤postURLȤäƵꤲߤ

Ѥ
³ɤ
    Υȥ꡼ϤƤʥ֥åޡɲ

ΥڡΥȥåץ