pushbullet 푸시 발송

· 10년 전 · 712

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]

 

 

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

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

프로그램

+
제목 글쓴이 날짜 조회
9년 전 조회 423
9년 전 조회 348
9년 전 조회 467
9년 전 조회 393
9년 전 조회 335
9년 전 조회 301
9년 전 조회 351
9년 전 조회 301
9년 전 조회 338
9년 전 조회 365
9년 전 조회 297
9년 전 조회 352
9년 전 조회 312
9년 전 조회 422
9년 전 조회 510
10년 전 조회 466
10년 전 조회 416
10년 전 조회 367
10년 전 조회 433
10년 전 조회 369
10년 전 조회 396
10년 전 조회 346
10년 전 조회 314
10년 전 조회 317
10년 전 조회 350
10년 전 조회 419
10년 전 조회 381
10년 전 조회 434
10년 전 조회 363
10년 전 조회 362
10년 전 조회 361
10년 전 조회 400
10년 전 조회 488
10년 전 조회 586
10년 전 조회 368
10년 전 조회 431
10년 전 조회 365
10년 전 조회 279
10년 전 조회 297
10년 전 조회 481
10년 전 조회 347
10년 전 조회 337
10년 전 조회 335
10년 전 조회 485
10년 전 조회 495
10년 전 조회 1,003
10년 전 조회 389
10년 전 조회 458
10년 전 조회 362
10년 전 조회 713
10년 전 조회 439
10년 전 조회 417
10년 전 조회 430
10년 전 조회 342
10년 전 조회 570
10년 전 조회 482
10년 전 조회 312
10년 전 조회 397
10년 전 조회 546
10년 전 조회 273
10년 전 조회 313
10년 전 조회 332
10년 전 조회 753
10년 전 조회 449
10년 전 조회 451
10년 전 조회 508
10년 전 조회 459
10년 전 조회 679
10년 전 조회 548
10년 전 조회 494
10년 전 조회 495
10년 전 조회 485
10년 전 조회 467
10년 전 조회 399
10년 전 조회 875
10년 전 조회 388
10년 전 조회 422
10년 전 조회 630
10년 전 조회 410
10년 전 조회 476
10년 전 조회 329
10년 전 조회 581
10년 전 조회 412
10년 전 조회 381
10년 전 조회 379
10년 전 조회 1,043
10년 전 조회 427
10년 전 조회 416
10년 전 조회 399
10년 전 조회 535
10년 전 조회 992
10년 전 조회 575
10년 전 조회 413
10년 전 조회 373
10년 전 조회 393
10년 전 조회 453
10년 전 조회 378
10년 전 조회 439
10년 전 조회 361
10년 전 조회 504
🐛 버그신고