pushbullet 푸시 발송

· 10년 전 · 829

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년 전 조회 533
9년 전 조회 466
9년 전 조회 569
9년 전 조회 507
9년 전 조회 443
9년 전 조회 406
9년 전 조회 455
9년 전 조회 394
10년 전 조회 439
10년 전 조회 471
10년 전 조회 401
10년 전 조회 452
10년 전 조회 412
10년 전 조회 519
10년 전 조회 620
10년 전 조회 577
10년 전 조회 530
10년 전 조회 452
10년 전 조회 547
10년 전 조회 466
10년 전 조회 499
10년 전 조회 449
10년 전 조회 430
10년 전 조회 433
10년 전 조회 459
10년 전 조회 529
10년 전 조회 483
10년 전 조회 543
10년 전 조회 464
10년 전 조회 475
10년 전 조회 474
10년 전 조회 503
10년 전 조회 599
10년 전 조회 695
10년 전 조회 475
10년 전 조회 542
10년 전 조회 469
10년 전 조회 399
10년 전 조회 408
10년 전 조회 575
10년 전 조회 465
10년 전 조회 452
10년 전 조회 446
10년 전 조회 597
10년 전 조회 607
10년 전 조회 1,120
10년 전 조회 504
10년 전 조회 573
10년 전 조회 487
10년 전 조회 830
10년 전 조회 554
10년 전 조회 536
10년 전 조회 513
10년 전 조회 462
10년 전 조회 708
10년 전 조회 611
10년 전 조회 433
10년 전 조회 525
10년 전 조회 660
10년 전 조회 385
10년 전 조회 432
10년 전 조회 449
10년 전 조회 884
10년 전 조회 567
10년 전 조회 566
10년 전 조회 594
10년 전 조회 578
10년 전 조회 804
10년 전 조회 668
10년 전 조회 621
10년 전 조회 612
10년 전 조회 611
10년 전 조회 593
10년 전 조회 529
10년 전 조회 1,005
10년 전 조회 512
10년 전 조회 540
10년 전 조회 756
10년 전 조회 532
10년 전 조회 595
10년 전 조회 451
10년 전 조회 732
10년 전 조회 536
10년 전 조회 481
10년 전 조회 468
10년 전 조회 1,175
10년 전 조회 552
10년 전 조회 548
10년 전 조회 508
10년 전 조회 671
10년 전 조회 1,113
10년 전 조회 704
10년 전 조회 551
10년 전 조회 492
10년 전 조회 533
10년 전 조회 584
10년 전 조회 516
10년 전 조회 581
10년 전 조회 500
10년 전 조회 645
🐛 버그신고