텔

pushbullet 푸시 발송

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

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,662
16-02-04 조회 3,214
16-02-04 조회 3,505
16-02-04 조회 3,316
16-02-03 조회 3,276
16-02-03 조회 3,015
16-02-03 조회 3,066
16-02-03 조회 2,978
16-02-03 조회 3,094
16-02-02 조회 3,133
16-02-02 조회 3,032
16-02-02 조회 3,052
16-02-02 조회 2,937
16-02-02 조회 3,357
16-02-01 조회 2,941
16-02-01 조회 2,740
16-02-01 조회 2,722
16-01-31 조회 2,754
16-01-31 조회 2,763
16-01-31 조회 2,773
16-01-30 조회 3,178
16-01-30 조회 2,763
16-01-30 조회 2,743
16-01-30 조회 2,941
16-01-30 조회 3,120
16-01-30 조회 2,887
16-01-29 조회 2,751
16-01-29 조회 2,756
16-01-29 조회 2,641
16-01-29 조회 2,625
16-01-28 조회 3,146
16-01-28 조회 2,954
16-01-28 조회 2,567
16-01-28 조회 2,481
16-01-28 조회 2,730
16-01-27 조회 2,659
16-01-27 조회 2,645
16-01-27 조회 2,646
16-01-26 조회 2,645
16-01-26 조회 2,626
16-01-26 조회 2,634
16-01-26 조회 2,979
16-01-25 조회 2,655
16-01-25 조회 2,692
16-01-25 조회 2,709
16-01-25 조회 2,573
16-01-24 조회 2,565
16-01-24 조회 2,566
16-01-24 조회 2,484
16-01-23 조회 2,527
16-01-23 조회 2,543
16-01-23 조회 2,527
16-01-22 조회 2,662
16-01-22 조회 2,814
16-01-22 조회 2,683
16-01-22 조회 2,774
16-01-21 조회 3,019
16-01-21 조회 2,664
16-01-21 조회 2,645
16-01-21 조회 2,654
16-01-21 조회 2,615
16-01-20 조회 2,659
16-01-20 조회 2,582
16-01-20 조회 2,524
16-01-20 조회 2,730
16-01-19 조회 2,554
16-01-19 조회 2,604
16-01-19 조회 2,577
16-01-19 조회 2,616
16-01-19 조회 2,803
16-01-18 조회 2,592
16-01-18 조회 2,577
16-01-18 조회 2,591
16-01-18 조회 2,742
16-01-17 조회 2,770
16-01-17 조회 2,626
16-01-17 조회 2,693
16-01-16 조회 2,531
16-01-16 조회 2,463
16-01-16 조회 2,526
16-01-15 조회 2,688
16-01-15 조회 2,687
16-01-15 조회 2,600
16-01-15 조회 2,536
16-01-14 조회 2,695
16-01-14 조회 2,834
16-01-14 조회 3,293
16-01-14 조회 2,596
16-01-14 조회 2,832
16-01-14 조회 2,614
16-01-13 조회 3,055
16-01-13 조회 2,672
16-01-13 조회 2,638
16-01-13 조회 2,670
16-01-13 조회 2,564
16-01-12 조회 3,015
16-01-12 조회 2,730
16-01-12 조회 2,743
16-01-12 조회 2,665
16-01-11 조회 2,799