pushbullet 푸시 발송

· 10년 전 · 730

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년 전 조회 438
9년 전 조회 370
9년 전 조회 486
9년 전 조회 417
9년 전 조회 355
9년 전 조회 320
9년 전 조회 371
9년 전 조회 323
9년 전 조회 354
9년 전 조회 382
9년 전 조회 314
9년 전 조회 368
9년 전 조회 333
9년 전 조회 434
9년 전 조회 530
10년 전 조회 488
10년 전 조회 438
10년 전 조회 379
10년 전 조회 453
10년 전 조회 386
10년 전 조회 413
10년 전 조회 361
10년 전 조회 333
10년 전 조회 335
10년 전 조회 367
10년 전 조회 431
10년 전 조회 398
10년 전 조회 447
10년 전 조회 377
10년 전 조회 380
10년 전 조회 385
10년 전 조회 421
10년 전 조회 505
10년 전 조회 608
10년 전 조회 392
10년 전 조회 449
10년 전 조회 380
10년 전 조회 299
10년 전 조회 321
10년 전 조회 497
10년 전 조회 371
10년 전 조회 354
10년 전 조회 350
10년 전 조회 503
10년 전 조회 516
10년 전 조회 1,024
10년 전 조회 410
10년 전 조회 479
10년 전 조회 389
10년 전 조회 731
10년 전 조회 465
10년 전 조회 442
10년 전 조회 439
10년 전 조회 355
10년 전 조회 593
10년 전 조회 508
10년 전 조회 329
10년 전 조회 419
10년 전 조회 559
10년 전 조회 291
10년 전 조회 338
10년 전 조회 355
10년 전 조회 773
10년 전 조회 469
10년 전 조회 473
10년 전 조회 522
10년 전 조회 478
10년 전 조회 701
10년 전 조회 570
10년 전 조회 512
10년 전 조회 509
10년 전 조회 504
10년 전 조회 491
10년 전 조회 422
10년 전 조회 901
10년 전 조회 408
10년 전 조회 439
10년 전 조회 663
10년 전 조회 431
10년 전 조회 499
10년 전 조회 350
10년 전 조회 614
10년 전 조회 436
10년 전 조회 390
10년 전 조회 389
10년 전 조회 1,061
10년 전 조회 447
10년 전 조회 442
10년 전 조회 416
10년 전 조회 565
10년 전 조회 1,011
10년 전 조회 602
10년 전 조회 436
10년 전 조회 394
10년 전 조회 421
10년 전 조회 473
10년 전 조회 400
10년 전 조회 463
10년 전 조회 381
10년 전 조회 522
🐛 버그신고