pushbullet 푸시 발송

· 10년 전 · 774

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년 전 조회 484
9년 전 조회 405
9년 전 조회 522
9년 전 조회 457
9년 전 조회 389
9년 전 조회 350
9년 전 조회 408
9년 전 조회 353
9년 전 조회 388
9년 전 조회 411
9년 전 조회 351
10년 전 조회 397
10년 전 조회 367
10년 전 조회 468
10년 전 조회 566
10년 전 조회 519
10년 전 조회 476
10년 전 조회 406
10년 전 조회 492
10년 전 조회 414
10년 전 조회 446
10년 전 조회 397
10년 전 조회 371
10년 전 조회 369
10년 전 조회 407
10년 전 조회 474
10년 전 조회 427
10년 전 조회 487
10년 전 조회 405
10년 전 조회 421
10년 전 조회 416
10년 전 조회 456
10년 전 조회 544
10년 전 조회 641
10년 전 조회 424
10년 전 조회 482
10년 전 조회 409
10년 전 조회 340
10년 전 조회 348
10년 전 조회 527
10년 전 조회 411
10년 전 조회 392
10년 전 조회 386
10년 전 조회 543
10년 전 조회 544
10년 전 조회 1,065
10년 전 조회 448
10년 전 조회 516
10년 전 조회 427
10년 전 조회 775
10년 전 조회 497
10년 전 조회 484
10년 전 조회 461
10년 전 조회 406
10년 전 조회 641
10년 전 조회 547
10년 전 조회 373
10년 전 조회 469
10년 전 조회 604
10년 전 조회 323
10년 전 조회 383
10년 전 조회 385
10년 전 조회 826
10년 전 조회 505
10년 전 조회 513
10년 전 조회 547
10년 전 조회 516
10년 전 조회 747
10년 전 조회 615
10년 전 조회 557
10년 전 조회 551
10년 전 조회 550
10년 전 조회 535
10년 전 조회 466
10년 전 조회 942
10년 전 조회 451
10년 전 조회 479
10년 전 조회 700
10년 전 조회 475
10년 전 조회 539
10년 전 조회 396
10년 전 조회 668
10년 전 조회 476
10년 전 조회 422
10년 전 조회 428
10년 전 조회 1,114
10년 전 조회 491
10년 전 조회 483
10년 전 조회 459
10년 전 조회 607
10년 전 조회 1,043
10년 전 조회 645
10년 전 조회 499
10년 전 조회 437
10년 전 조회 474
10년 전 조회 532
10년 전 조회 453
10년 전 조회 524
10년 전 조회 435
10년 전 조회 578
🐛 버그신고