pushbullet 푸시 발송

· 10년 전 · 763

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년 전 조회 470
9년 전 조회 400
9년 전 조회 513
9년 전 조회 445
9년 전 조회 380
9년 전 조회 342
9년 전 조회 396
9년 전 조회 346
9년 전 조회 378
9년 전 조회 405
9년 전 조회 339
9년 전 조회 388
9년 전 조회 356
9년 전 조회 454
9년 전 조회 557
10년 전 조회 512
10년 전 조회 466
10년 전 조회 391
10년 전 조회 477
10년 전 조회 408
10년 전 조회 436
10년 전 조회 385
10년 전 조회 362
10년 전 조회 358
10년 전 조회 390
10년 전 조회 463
10년 전 조회 419
10년 전 조회 477
10년 전 조회 398
10년 전 조회 404
10년 전 조회 406
10년 전 조회 447
10년 전 조회 532
10년 전 조회 630
10년 전 조회 416
10년 전 조회 473
10년 전 조회 399
10년 전 조회 330
10년 전 조회 340
10년 전 조회 515
10년 전 조회 396
10년 전 조회 383
10년 전 조회 376
10년 전 조회 526
10년 전 조회 536
10년 전 조회 1,051
10년 전 조회 436
10년 전 조회 500
10년 전 조회 417
10년 전 조회 764
10년 전 조회 491
10년 전 조회 474
10년 전 조회 450
10년 전 조회 392
10년 전 조회 628
10년 전 조회 537
10년 전 조회 361
10년 전 조회 455
10년 전 조회 592
10년 전 조회 313
10년 전 조회 373
10년 전 조회 380
10년 전 조회 811
10년 전 조회 494
10년 전 조회 503
10년 전 조회 534
10년 전 조회 502
10년 전 조회 728
10년 전 조회 604
10년 전 조회 544
10년 전 조회 530
10년 전 조회 540
10년 전 조회 525
10년 전 조회 454
10년 전 조회 928
10년 전 조회 439
10년 전 조회 465
10년 전 조회 689
10년 전 조회 464
10년 전 조회 527
10년 전 조회 387
10년 전 조회 651
10년 전 조회 461
10년 전 조회 411
10년 전 조회 419
10년 전 조회 1,097
10년 전 조회 474
10년 전 조회 471
10년 전 조회 444
10년 전 조회 595
10년 전 조회 1,031
10년 전 조회 628
10년 전 조회 482
10년 전 조회 421
10년 전 조회 456
10년 전 조회 512
10년 전 조회 438
10년 전 조회 507
10년 전 조회 418
10년 전 조회 560
🐛 버그신고