pushbullet 푸시 발송

· 10년 전 · 764

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년 전 조회 401
9년 전 조회 513
9년 전 조회 445
9년 전 조회 380
9년 전 조회 342
9년 전 조회 396
9년 전 조회 346
9년 전 조회 379
9년 전 조회 405
9년 전 조회 339
9년 전 조회 388
9년 전 조회 356
9년 전 조회 455
9년 전 조회 557
10년 전 조회 513
10년 전 조회 466
10년 전 조회 393
10년 전 조회 479
10년 전 조회 408
10년 전 조회 436
10년 전 조회 385
10년 전 조회 362
10년 전 조회 359
10년 전 조회 392
10년 전 조회 464
10년 전 조회 419
10년 전 조회 477
10년 전 조회 398
10년 전 조회 405
10년 전 조회 407
10년 전 조회 448
10년 전 조회 534
10년 전 조회 631
10년 전 조회 416
10년 전 조회 476
10년 전 조회 400
10년 전 조회 331
10년 전 조회 341
10년 전 조회 515
10년 전 조회 396
10년 전 조회 385
10년 전 조회 377
10년 전 조회 527
10년 전 조회 536
10년 전 조회 1,053
10년 전 조회 437
10년 전 조회 502
10년 전 조회 418
10년 전 조회 765
10년 전 조회 491
10년 전 조회 474
10년 전 조회 451
10년 전 조회 393
10년 전 조회 629
10년 전 조회 538
10년 전 조회 363
10년 전 조회 457
10년 전 조회 593
10년 전 조회 314
10년 전 조회 373
10년 전 조회 380
10년 전 조회 811
10년 전 조회 494
10년 전 조회 503
10년 전 조회 536
10년 전 조회 502
10년 전 조회 729
10년 전 조회 604
10년 전 조회 545
10년 전 조회 530
10년 전 조회 541
10년 전 조회 525
10년 전 조회 454
10년 전 조회 929
10년 전 조회 439
10년 전 조회 468
10년 전 조회 689
10년 전 조회 466
10년 전 조회 527
10년 전 조회 388
10년 전 조회 652
10년 전 조회 461
10년 전 조회 413
10년 전 조회 419
10년 전 조회 1,100
10년 전 조회 476
10년 전 조회 472
10년 전 조회 446
10년 전 조회 597
10년 전 조회 1,033
10년 전 조회 629
10년 전 조회 486
10년 전 조회 423
10년 전 조회 458
10년 전 조회 516
10년 전 조회 441
10년 전 조회 509
10년 전 조회 422
10년 전 조회 562
🐛 버그신고