텔

pushbullet 푸시 발송

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

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,187건
+
제목 글쓴이 날짜 조회
16-02-06 조회 3,644
16-02-04 조회 3,201
16-02-04 조회 3,492
16-02-04 조회 3,195
16-02-03 조회 3,259
16-02-03 조회 3,007
16-02-03 조회 3,052
16-02-03 조회 2,968
16-02-03 조회 3,081
16-02-02 조회 3,118
16-02-02 조회 3,018
16-02-02 조회 3,041
16-02-02 조회 2,926
16-02-02 조회 3,338
16-02-01 조회 2,925
16-02-01 조회 2,733
16-02-01 조회 2,712
16-01-31 조회 2,738
16-01-31 조회 2,752
16-01-31 조회 2,753
16-01-30 조회 3,154
16-01-30 조회 2,753
16-01-30 조회 2,734
16-01-30 조회 2,931
16-01-30 조회 3,073
16-01-30 조회 2,871
16-01-29 조회 2,737
16-01-29 조회 2,739
16-01-29 조회 2,628
16-01-29 조회 2,612
16-01-28 조회 3,099
16-01-28 조회 2,947
16-01-28 조회 2,562
16-01-28 조회 2,467
16-01-28 조회 2,717
16-01-27 조회 2,652
16-01-27 조회 2,638
16-01-27 조회 2,637
16-01-26 조회 2,633
16-01-26 조회 2,610
16-01-26 조회 2,626
16-01-26 조회 2,927
16-01-25 조회 2,633
16-01-25 조회 2,679
16-01-25 조회 2,689
16-01-25 조회 2,560
16-01-24 조회 2,553
16-01-24 조회 2,553
16-01-24 조회 2,472
16-01-23 조회 2,520
16-01-23 조회 2,531
16-01-23 조회 2,507
16-01-22 조회 2,648
16-01-22 조회 2,763
16-01-22 조회 2,667
16-01-22 조회 2,750
16-01-21 조회 2,780
16-01-21 조회 2,655
16-01-21 조회 2,637
16-01-21 조회 2,642
16-01-21 조회 2,599
16-01-20 조회 2,642
16-01-20 조회 2,566
16-01-20 조회 2,516
16-01-20 조회 2,717
16-01-19 조회 2,541
16-01-19 조회 2,579
16-01-19 조회 2,566
16-01-19 조회 2,599
16-01-19 조회 2,792
16-01-18 조회 2,579
16-01-18 조회 2,568
16-01-18 조회 2,583
16-01-18 조회 2,732
16-01-17 조회 2,760
16-01-17 조회 2,612
16-01-17 조회 2,678
16-01-16 조회 2,517
16-01-16 조회 2,452
16-01-16 조회 2,513
16-01-15 조회 2,668
16-01-15 조회 2,664
16-01-15 조회 2,586
16-01-15 조회 2,518
16-01-14 조회 2,681
16-01-14 조회 2,820
16-01-14 조회 3,275
16-01-14 조회 2,570
16-01-14 조회 2,799
16-01-14 조회 2,603
16-01-13 조회 3,046
16-01-13 조회 2,661
16-01-13 조회 2,629
16-01-13 조회 2,658
16-01-13 조회 2,542
16-01-12 조회 2,963
16-01-12 조회 2,723
16-01-12 조회 2,728
16-01-12 조회 2,653
16-01-11 조회 2,776