텔

pushbullet 푸시 발송

· 2016-01-13 (수) 19:31:49 · 2841

api가 쉽게 되어있어 급하게 만들어 보았습니다.

 

 

# pushbullet.class.php
[code]

<?php

class oh_push {

 

var $token_key;

var $push_url = 'https://api.pushbullet.com/v2/pushes';

 

public function __construct($token_key) {

$this->token_key = $token_key;

}

 

public function token() {

return $this->token_key;

}

 

public function send($email=array(), $body='', $title='') {

 

$type = 'note';

foreach($email as $k=>$v) {

 

$push_param = 'type='.$type.'&email='.$v.'&title='.$title.'&body='.$body;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $this->push_url);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $push_param);

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Access-Token: '.$this->token_key));

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

curl_close($ch);

}

}

}

 

$oh_push = new oh_push('토큰키');

$oh_push->send(array('이메일'), '내용', '제목');

[/code]

 

 

토큰은 푸시불렛의 셋팅에서 받을수 있습니다.

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-07-13 조회 2,160
16-07-12 조회 2,332
16-07-12 조회 2,361
16-07-11 조회 2,185
16-06-05 조회 2,902
16-06-03 조회 3,009
16-05-26 조회 2,928
15-09-22 조회 4,979
15-06-10 조회 4,817
14-10-25 조회 6,349
14-10-22 조회 8,976
14-09-21 조회 5,776
14-09-16 조회 5,061
14-08-22 조회 1.1만
14-08-13 조회 5,896
14-08-12 조회 5,431
14-08-12 조회 6,286
14-08-11 조회 6,919
14-06-12 조회 6,194
14-06-11 조회 5,100
14-05-09 조회 5,412
14-05-09 조회 6,372
14-05-09 조회 6,400
14-05-08 조회 5,736
14-04-17 조회 4,735
14-04-16 조회 4,569
14-04-15 조회 4,572
14-04-15 조회 4,525
14-04-15 조회 4,292
14-04-14 조회 4,279
14-04-14 조회 4,242
14-04-14 조회 4,621
14-04-14 조회 4,764
14-04-14 조회 4,751
14-04-13 조회 4,651
14-04-12 조회 4,214
14-04-12 조회 4,362
14-04-12 조회 4,467
14-04-11 조회 4,999
14-04-10 조회 4,731
14-04-10 조회 4,765
14-04-09 조회 4,928
14-04-09 조회 5,291
14-04-08 조회 6,956
13-10-30 조회 7,650
13-07-11 조회 5,117
13-03-28 조회 1.1만
13-02-27 조회 6,774
13-02-14 조회 5,594
13-01-10 조회 4,508
12-12-31 조회 5,086
12-12-20 조회 6,106
12-12-12 조회 5,264
12-12-07 조회 4,485
12-11-28 조회 4,837
12-11-22 조회 5,271
12-11-12 조회 5,641
12-09-22 조회 4,501
12-09-18 조회 4,696