pushbullet 푸시 발송

· 10년 전 · 879

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년 전 조회 571
10년 전 조회 511
10년 전 조회 601
10년 전 조회 537
10년 전 조회 488
10년 전 조회 441
10년 전 조회 491
10년 전 조회 463
10년 전 조회 476
10년 전 조회 507
10년 전 조회 445
10년 전 조회 490
10년 전 조회 450
10년 전 조회 554
10년 전 조회 650
10년 전 조회 611
10년 전 조회 569
10년 전 조회 493
10년 전 조회 596
10년 전 조회 494
10년 전 조회 529
10년 전 조회 479
10년 전 조회 459
10년 전 조회 455
10년 전 조회 490
10년 전 조회 557
10년 전 조회 509
10년 전 조회 590
10년 전 조회 495
10년 전 조회 529
10년 전 조회 500
10년 전 조회 570
10년 전 조회 643
10년 전 조회 735
10년 전 조회 510
10년 전 조회 579
10년 전 조회 498
10년 전 조회 440
10년 전 조회 435
10년 전 조회 615
10년 전 조회 519
10년 전 조회 487
10년 전 조회 492
10년 전 조회 659
10년 전 조회 634
10년 전 조회 1,153
10년 전 조회 539
10년 전 조회 607
10년 전 조회 515
10년 전 조회 880
10년 전 조회 581
10년 전 조회 590
10년 전 조회 552
10년 전 조회 488
10년 전 조회 750
10년 전 조회 669
10년 전 조회 471
10년 전 조회 584
10년 전 조회 697
10년 전 조회 416
10년 전 조회 489
10년 전 조회 473
10년 전 조회 935
10년 전 조회 592
10년 전 조회 642
10년 전 조회 624
10년 전 조회 601
10년 전 조회 831
10년 전 조회 701
10년 전 조회 656
10년 전 조회 642
10년 전 조회 653
10년 전 조회 649
10년 전 조회 584
10년 전 조회 1,044
10년 전 조회 558
10년 전 조회 565
10년 전 조회 802
10년 전 조회 579
10년 전 조회 624
10년 전 조회 495
10년 전 조회 769
10년 전 조회 565
10년 전 조회 505
10년 전 조회 537
10년 전 조회 1,220
10년 전 조회 588
10년 전 조회 577
10년 전 조회 564
10년 전 조회 718
10년 전 조회 1,139
10년 전 조회 735
10년 전 조회 612
10년 전 조회 513
10년 전 조회 562
10년 전 조회 616
10년 전 조회 580
10년 전 조회 641
10년 전 조회 543
10년 전 조회 680
🐛 버그신고