pushbullet 푸시 발송

· 10년 전 · 869

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]

 

 

토큰은 푸시불렛의 셋팅에서 받을수 있습니다.

|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
10년 전 조회 564
10년 전 조회 505
10년 전 조회 594
10년 전 조회 530
10년 전 조회 477
10년 전 조회 431
10년 전 조회 481
10년 전 조회 444
10년 전 조회 464
10년 전 조회 500
10년 전 조회 434
10년 전 조회 479
10년 전 조회 444
10년 전 조회 544
10년 전 조회 643
10년 전 조회 604
10년 전 조회 556
10년 전 조회 489
10년 전 조회 584
10년 전 조회 491
10년 전 조회 525
10년 전 조회 474
10년 전 조회 454
10년 전 조회 452
10년 전 조회 485
10년 전 조회 549
10년 전 조회 504
10년 전 조회 579
10년 전 조회 488
10년 전 조회 519
10년 전 조회 494
10년 전 조회 555
10년 전 조회 635
10년 전 조회 728
10년 전 조회 502
10년 전 조회 574
10년 전 조회 495
10년 전 조회 432
10년 전 조회 433
10년 전 조회 614
10년 전 조회 501
10년 전 조회 480
10년 전 조회 480
10년 전 조회 639
10년 전 조회 629
10년 전 조회 1,144
10년 전 조회 533
10년 전 조회 605
10년 전 조회 513
10년 전 조회 870
10년 전 조회 579
10년 전 조회 578
10년 전 조회 547
10년 전 조회 485
10년 전 조회 739
10년 전 조회 650
10년 전 조회 464
10년 전 조회 571
10년 전 조회 690
10년 전 조회 412
10년 전 조회 474
10년 전 조회 472
10년 전 조회 921
10년 전 조회 590
10년 전 조회 624
10년 전 조회 621
10년 전 조회 597
10년 전 조회 827
10년 전 조회 696
10년 전 조회 647
10년 전 조회 642
10년 전 조회 646
10년 전 조회 642
10년 전 조회 570
10년 전 조회 1,033
10년 전 조회 549
10년 전 조회 560
10년 전 조회 792
10년 전 조회 570
10년 전 조회 616
10년 전 조회 484
10년 전 조회 757
10년 전 조회 560
10년 전 조회 503
10년 전 조회 514
10년 전 조회 1,206
10년 전 조회 578
10년 전 조회 568
10년 전 조회 553
10년 전 조회 711
10년 전 조회 1,132
10년 전 조회 728
10년 전 조회 591
10년 전 조회 512
10년 전 조회 554
10년 전 조회 603
10년 전 조회 562
10년 전 조회 620
10년 전 조회 531
10년 전 조회 670
🐛 버그신고