pushbullet 푸시 발송

· 10년 전 · 798

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년 전 조회 497
9년 전 조회 422
9년 전 조회 538
9년 전 조회 468
9년 전 조회 410
9년 전 조회 371
9년 전 조회 417
9년 전 조회 367
9년 전 조회 400
9년 전 조회 433
9년 전 조회 369
10년 전 조회 413
10년 전 조회 382
10년 전 조회 491
10년 전 조회 580
10년 전 조회 539
10년 전 조회 492
10년 전 조회 424
10년 전 조회 509
10년 전 조회 429
10년 전 조회 457
10년 전 조회 413
10년 전 조회 384
10년 전 조회 391
10년 전 조회 431
10년 전 조회 487
10년 전 조회 444
10년 전 조회 501
10년 전 조회 425
10년 전 조회 440
10년 전 조회 429
10년 전 조회 476
10년 전 조회 564
10년 전 조회 655
10년 전 조회 435
10년 전 조회 504
10년 전 조회 429
10년 전 조회 360
10년 전 조회 363
10년 전 조회 541
10년 전 조회 431
10년 전 조회 413
10년 전 조회 409
10년 전 조회 559
10년 전 조회 563
10년 전 조회 1,079
10년 전 조회 467
10년 전 조회 536
10년 전 조회 440
10년 전 조회 799
10년 전 조회 516
10년 전 조회 505
10년 전 조회 476
10년 전 조회 427
10년 전 조회 668
10년 전 조회 571
10년 전 조회 395
10년 전 조회 491
10년 전 조회 617
10년 전 조회 345
10년 전 조회 405
10년 전 조회 407
10년 전 조회 843
10년 전 조회 524
10년 전 조회 533
10년 전 조회 559
10년 전 조회 536
10년 전 조회 764
10년 전 조회 627
10년 전 조회 573
10년 전 조회 578
10년 전 조회 570
10년 전 조회 556
10년 전 조회 488
10년 전 조회 965
10년 전 조회 473
10년 전 조회 496
10년 전 조회 714
10년 전 조회 501
10년 전 조회 558
10년 전 조회 415
10년 전 조회 682
10년 전 조회 502
10년 전 조회 442
10년 전 조회 442
10년 전 조회 1,135
10년 전 조회 512
10년 전 조회 504
10년 전 조회 476
10년 전 조회 629
10년 전 조회 1,063
10년 전 조회 667
10년 전 조회 519
10년 전 조회 456
10년 전 조회 491
10년 전 조회 547
10년 전 조회 474
10년 전 조회 542
10년 전 조회 460
10년 전 조회 592
🐛 버그신고