pushbullet 푸시 발송

· 10년 전 · 814

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년 전 조회 516
9년 전 조회 445
9년 전 조회 556
9년 전 조회 492
9년 전 조회 427
9년 전 조회 389
9년 전 조회 441
9년 전 조회 380
9년 전 조회 424
9년 전 조회 452
9년 전 조회 388
10년 전 조회 433
10년 전 조회 399
10년 전 조회 504
10년 전 조회 599
10년 전 조회 554
10년 전 조회 512
10년 전 조회 439
10년 전 조회 529
10년 전 조회 449
10년 전 조회 480
10년 전 조회 432
10년 전 조회 406
10년 전 조회 409
10년 전 조회 446
10년 전 조회 511
10년 전 조회 462
10년 전 조회 528
10년 전 조회 442
10년 전 조회 455
10년 전 조회 453
10년 전 조회 493
10년 전 조회 582
10년 전 조회 677
10년 전 조회 462
10년 전 조회 525
10년 전 조회 447
10년 전 조회 383
10년 전 조회 385
10년 전 조회 562
10년 전 조회 452
10년 전 조회 433
10년 전 조회 427
10년 전 조회 578
10년 전 조회 584
10년 전 조회 1,096
10년 전 조회 487
10년 전 조회 558
10년 전 조회 471
10년 전 조회 815
10년 전 조회 542
10년 전 조회 522
10년 전 조회 495
10년 전 조회 442
10년 전 조회 691
10년 전 조회 588
10년 전 조회 418
10년 전 조회 506
10년 전 조회 642
10년 전 조회 362
10년 전 조회 415
10년 전 조회 434
10년 전 조회 862
10년 전 조회 544
10년 전 조회 552
10년 전 조회 574
10년 전 조회 562
10년 전 조회 785
10년 전 조회 657
10년 전 조회 598
10년 전 조회 597
10년 전 조회 592
10년 전 조회 577
10년 전 조회 509
10년 전 조회 989
10년 전 조회 493
10년 전 조회 523
10년 전 조회 737
10년 전 조회 515
10년 전 조회 580
10년 전 조회 429
10년 전 조회 710
10년 전 조회 519
10년 전 조회 463
10년 전 조회 458
10년 전 조회 1,157
10년 전 조회 537
10년 전 조회 529
10년 전 조회 487
10년 전 조회 646
10년 전 조회 1,086
10년 전 조회 692
10년 전 조회 534
10년 전 조회 477
10년 전 조회 513
10년 전 조회 567
10년 전 조회 500
10년 전 조회 561
10년 전 조회 478
10년 전 조회 623
🐛 버그신고